all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 74394@debbugs.gnu.org
Cc: "Maxim Cournoyer" <maxim.cournoyer@gmail.com>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [bug#74394] [PATCH 1/2] build: Exclude expensive tests in check target by default.
Date: Sun, 17 Nov 2024 21:21:46 +0900	[thread overview]
Message-ID: <5664cb3f6c9a888c74dd74a29912578e30697c72.1731844485.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <cover.1731844485.git.maxim.cournoyer@gmail.com>

This reduces the test time of 'make -j check' from ~22 minutes to a bit more than one
minute on a fast machine.

* Makefile.am [CAN_RUN_TESTS] (check-local): New target.
* tests/guix-home.sh: Skip unless WITH_SLOW_TESTS is 1.
* tests/guix-package.sh: Likewise.
* tests/guix-system.sh: Likewise.
* tests/guix-time-machine.sh: Exclude one command.

Change-Id: Ieb61bf5d54aedd4bd32f93da792a4ac7dd8b9e7d
---
 Makefile.am                | 9 ++++++++-
 tests/guix-home.sh         | 5 +++++
 tests/guix-package.sh      | 5 +++++
 tests/guix-system.sh       | 4 ++++
 tests/guix-time-machine.sh | 4 +++-
 5 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e94ba87797..4bec4d4a06 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@
 # Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
 # Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 # Copyright © 2019, 2023 Efraim Flashner <efraim@flashner.co.il>
-# Copyright © 2020, 2021, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2020, 2021, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
 # Copyright © 2021 Andrew Tropin <andrew@trop.in>
 # Copyright © 2023 Clément Lassieur <clement@lassieur.org>
@@ -668,6 +668,13 @@ tests/guix-gc.log:							\
   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))	\
   $(SCM_TESTS:%.scm=%.log)
 
+check-local:
+	@echo
+	@if [ "$$WITH_SLOW_TESTS" != 1 ]; then \
+	   echo "Skipping slow tests; set WITH_SLOW_TESTS to 1 to run them"; \
+	fi
+	@echo
+
 else !CAN_RUN_TESTS
 
 TESTS =
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 649d811a0c..1c7b6da1cd 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -22,6 +22,11 @@
 # Test the 'guix home' using the external store, if any.
 #
 
+# This test is very expensive as guix-home appears to refer to the
+# current-guix package, which must be built the first time it runs (~20
+# minutes on a fast machine).
+test "$WITH_SLOW_TESTS" != 1 && exit 77
+
 set -e
 
 guix home --version
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 945d59cdfb..5b9af19153 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -22,6 +22,11 @@
 # Test the `guix package' command-line utility.
 #
 
+# This test contains expensive operations such as 'guix package -A', which
+# cumulate into a total test time of multiple minutes (about 2 minutes on a
+# fast machine).
+test "$WITH_SLOW_TESTS" != 1 && exit 77
+
 guix package --version
 
 readlink_base ()
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 99147cf332..bd343ec4bc 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -22,6 +22,10 @@
 # Test 'guix system', mostly error reporting.
 #
 
+# This test is expensive as it builds the images of multiple operating
+# systems; it takes more than a minute to run on a fast machine.
+test "$WITH_SLOW_TESTS" != 1 && exit 77
+
 set -e
 
 guix system --version
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh
index df75c681da..70a2443376 100644
--- a/tests/guix-time-machine.sh
+++ b/tests/guix-time-machine.sh
@@ -41,6 +41,8 @@ fi
 
 # Visiting a commit older than v0.16.0 must fail (this test is expensive
 # because it clones the whole repository).
-guix time-machine -q --commit=v0.15.0 $EXTRA_OPTIONS -- describe && false
+if [ "$WITH_SLOW_TESTS" = 1 ]; then
+    guix time-machine -q --commit=v0.15.0 $EXTRA_OPTIONS -- describe && false
+fi
 
 true
-- 
2.46.0





  reply	other threads:[~2024-11-17 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-17 12:03 [bug#74394] [PATCH 0/2] Skip slow tests by default and run 'check' in Git pre-push hook Maxim Cournoyer
2024-11-17 12:21 ` Maxim Cournoyer [this message]
2024-11-17 12:21 ` [bug#74394] [PATCH 2/2] etc: Ensure test suite passes in pre-push git hook Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5664cb3f6c9a888c74dd74a29912578e30697c72.1731844485.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=74394@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.