| Message ID | 20220227135342.10296-9-ludo@gnu.org | 
|---|---|
| State | New | 
| Headers | Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 317C327BBEA; Sun, 27 Feb 2022 14:02:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEAEB27BBE9 for <patchwork@mira.cbaines.net>; Sun, 27 Feb 2022 14:02:06 +0000 (GMT) Received: from localhost ([::1]:41438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1nOK7h-0003Jo-Lw for patchwork@mira.cbaines.net; Sun, 27 Feb 2022 09:02:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nOK0w-0000WM-8T for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nOK0v-0001t0-5C for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nOK0v-0004uL-4M for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54180] [PATCH 09/12] tests: Check 'guix home reconfigure' for a second generation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 13:55:05 +0000 Resent-Message-ID: <handler.54180.B54180.164597006918739@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54180@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org> Received: via spool by 54180-submit@debbugs.gnu.org id=B54180.164597006918739 (code B ref 54180); Sun, 27 Feb 2022 13:55:05 +0000 Received: (at 54180) by debbugs.gnu.org; 27 Feb 2022 13:54:29 +0000 Received: from localhost ([127.0.0.1]:57170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1nOK0K-0004s4-KS for submit@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@gnu.org>) id 1nOK0B-0004qL-EB for 54180@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:20 -0500 Received: from [2001:470:142:3::e] (port=50244 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1nOK01-0001Zp-Cn; Sun, 27 Feb 2022 08:54:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=kRaL04jmZdrVlSDR58XrELI9WO17jDsb7AMDz2U7LbM=; b=QFC/VUdAih5+L7iDWGXR odFHQiJjnZVNzbGkR638kbJtfpNSxCqTu8ZBZmzbKdN3+wReJdF1rnO6zW8iDI8z7y2WVPHa4/cXC bvO712P9ALmtRk25Lb/fzNw0b1hn3gXuHmicw9RSGdit5fK99vwvYRAWaOwbFxDpQHP0wEMggddO6 MCMp1CYhzgn5YZybYxGOQhOy2ug78K39mg/WgiH4M5AaxTCNeC0Y8goj0y/fxc5nLzcEUDMIRuQgG Gx0oQofwyn2OUilCyAvSLt1QGtUVSX53apK9UTYZq9tG89QNkgqyQPfyjSQ/CBwaHDG24uuUFFO0y RvXijYW/DidjyA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55804 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1nOJzz-0007Pg-VT; Sun, 27 Feb 2022 08:54:09 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org> Date: Sun, 27 Feb 2022 14:53:39 +0100 Message-Id: <20220227135342.10296-9-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220227135342.10296-1-ludo@gnu.org> References: <20220227135342.10296-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches | 
| Series | Home: Clarify and better test symlink-manager.scm
       | 
 | 
Commit Message
    Ludovic Courtès
    Feb. 27, 2022, 1:53 p.m. UTC
  
  * tests/guix-home.sh: Invoke "guix home reconfigure" a second time with a modify config file and check the result. --- tests/guix-home.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
Comments
Ludovic Courtès schreef op zo 27-02-2022 om 14:53 [+0100]: > * tests/guix-home.sh: Invoke "guix home reconfigure" a second time with > a modify config file and check the result. Something I don't understand, is why these tests are bash scripts in the first place. Wouldn't Scheme code suffice and be easier to reason about? For example, Scheme code would avoid repeating the complicated code for starting a daemon and making sure it exits in every .sh test. Greetings Maxime.
Maxime Devos <maximedevos@telenet.be> skribis: > Ludovic Courtès schreef op zo 27-02-2022 om 14:53 [+0100]: >> * tests/guix-home.sh: Invoke "guix home reconfigure" a second time with >> a modify config file and check the result. > > Something I don't understand, is why these tests are bash scripts in > the first place. > > Wouldn't Scheme code suffice and be easier to reason about? For > example, Scheme code would avoid repeating the complicated code for > starting a daemon and making sure it exits in every .sh test. It’s useful to have integration tests that exercise the commands; unit tests would also be welcome, but that’s what we have so far.
Ludovic Courtès schreef op za 05-03-2022 om 23:20 [+0100]: > It’s useful to have integration tests that exercise the commands; unit > tests would also be welcome, but that’s what we have so far. Integreation tests don't have to be in bash. We can have integration tests in Scheme, by running the 'guix-FOO' procedures from (guix scripts ...), like tests/substitute.scm and tests/publish.scm do. Greetings, Maxime.
p.s.,  I'm getting ‘Undelivered Mail Returned to Sender’:
This is the mail system at host taslin.fdn.fr.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
                   The mail system
<lcourtes@fdn.fr> (expanded from <ludovic.courtes@fdn.fr>): host
    taslin.fdn.fr[private/dovecot-lmtp] said: 552 5.2.2
<lcourtes@fdn.fr> Quota
    exceeded, please contact vlp. (in reply to end of DATA command)
  
Hi Maxime, Maxime Devos <maximedevos@telenet.be> skribis: > Ludovic Courtès schreef op za 05-03-2022 om 23:20 [+0100]: >> It’s useful to have integration tests that exercise the commands; unit >> tests would also be welcome, but that’s what we have so far. > > Integreation tests don't have to be in bash. We can have integration > tests in Scheme, by running the 'guix-FOO' procedures from (guix > scripts ...), like tests/substitute.scm and tests/publish.scm do. Yes, you’re right, but this patch series is not about rewriting the integration tests. :-) The way I see it, we can choose and combine different strategies: Bash tests (the good thing is that they’re as close as can be to what users run), Scheme integration tests like you write when more fine-grain control is needed, and of course unit tests. Ludo’.
Maxime Devos <maximedevos@telenet.be> skribis:
> p.s.,  I'm getting ‘Undelivered Mail Returned to Sender’:
I think that’s solved, but my mail setup is still in flux…  Don’t
hesitate to ping me on IRC or something if you think I might have missed
a message of yours.
Ludo’.
  
diff --git a/tests/guix-home.sh b/tests/guix-home.sh index 3b397649cc..f054d15172 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -108,6 +108,7 @@ EOF # Make sure preexisting files were backed up. grep "overridden" "$HOME"/*guix-home*backup/.bashrc grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf + rm -r "$HOME"/*guix-home*backup # # Test 'guix home describe'. @@ -131,6 +132,28 @@ EOF } test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" + # + # Configure a new generation. + # + + # Change the bashrc snippet content and comment out one service. + sed -i "home.scm" -e's/the content of/the NEW content of/g' + sed -i "home.scm" -e"s/(simple-service 'test-config/#;(simple-service 'test-config/g" + + guix home reconfigure "${test_directory}/home.scm" + test "$(tail -n 2 "${HOME}/.bashrc")" == "\ +# dot-bashrc test file for guix home +# the NEW content of bashrc-test-config.sh" + + # This file must have been removed and not backed up. + ! test -e "$HOME/.config/test.conf" + ! test -e "$HOME"/*guix-home*backup/.config/test.conf + + test "$(cat "$(configuration_file)")" == "$(cat home.scm)" + test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" + + test $(guix home list-generations | grep "^Generation" | wc -l) -eq 2 + # # Test 'guix home search'. #