From 196670af766d4ce77bf677c72edbcd94fb0afa60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Wed, 4 Oct 2023 17:10:54 +0200 Subject: [PATCH] Don't run the tests that require building if we're not building A couple of tests require building some libraries that depend on Nix, and assume it to be built locally. Don't run these if we only want to run the install tests. This prevents the CI from rebuilding several times Nix (like in https://github.com/NixOS/nix/actions/runs/6404422275/job/17384964033#step:6:6412), thus removing a fair amount of build time. (cherry picked from commit eb68454be61bd6e8baf40136ae69c2b5fec3006a) --- release.nix | 1 + tests/local.mk | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/release.nix b/release.nix index 7f8f53740..4ed34c638 100644 --- a/release.nix +++ b/release.nix @@ -230,6 +230,7 @@ let pkgs.releaseTools.nixBuild { NIX_DAEMON_PACKAGE = daemon; NIX_CLIENT_PACKAGE = client; + HAVE_LOCAL_NIX_BUILD = false; name = "nix-tests-${client.src.version}-against-${daemon.src.version}"; src = tarball; diff --git a/tests/local.mk b/tests/local.mk index 792983b09..447a20957 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -1,6 +1,10 @@ check: @echo "Warning: Nix has no 'make check'. Please install Nix and run 'make installcheck' instead." +# whether to run the tests that assume that we have a local build of +# Nix +HAVE_LOCAL_NIX_BUILD ?= 1 + nix_tests = \ init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ gc.sh \ @@ -27,7 +31,6 @@ nix_tests = \ brotli.sh \ pure-eval.sh \ check.sh \ - plugins.sh \ search.sh \ nix-copy-ssh.sh \ post-hook.sh \ @@ -35,10 +38,16 @@ nix_tests = \ test-infra.sh \ # parallel.sh +ifeq ($(HAVE_LOCAL_NIX_BUILD), 1) + nix_tests += plugins.sh +endif + +tests/plugins.sh.test: tests/plugins/libplugintest.$(SO_EXT) + install-tests += $(foreach x, $(nix_tests), tests/$(x)) tests-environment = NIX_REMOTE= $(bash) -e clean-files += $(d)/common.sh -test-deps += tests/common.sh tests/plugins/libplugintest.$(SO_EXT) +test-deps += tests/common.sh