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.
This commit is contained in:
Théophane Hufschmitt 2023-10-04 17:10:54 +02:00
parent 3c042f3b0b
commit eb68454be6
2 changed files with 17 additions and 8 deletions

View file

@ -260,6 +260,7 @@
testNixVersions = pkgs: client: daemon: with commonDeps { inherit pkgs; }; with pkgs.lib; pkgs.stdenv.mkDerivation {
NIX_DAEMON_PACKAGE = daemon;
NIX_CLIENT_PACKAGE = client;
HAVE_LOCAL_NIX_BUILD = false;
name =
"nix-tests"
+ optionalString

View file

@ -1,3 +1,7 @@
# whether to run the tests that assume that we have a local build of
# Nix
HAVE_LOCAL_NIX_BUILD ?= 1
nix_tests = \
test-infra.sh \
init.sh \
@ -104,7 +108,6 @@ nix_tests = \
case-hack.sh \
placeholders.sh \
ssh-relay.sh \
plugins.sh \
build.sh \
build-delete.sh \
output-normalization.sh \
@ -120,7 +123,6 @@ nix_tests = \
flakes/show.sh \
impure-derivations.sh \
path-from-hash-part.sh \
test-libstoreconsumer.sh \
toString-path.sh \
read-only-store.sh \
nested-sandboxing.sh
@ -129,6 +131,17 @@ ifeq ($(HAVE_LIBCPUID), 1)
nix_tests += compute-levels.sh
endif
ifeq ($(HAVE_LOCAL_NIX_BUILD), 1)
nix_tests += test-libstoreconsumer.sh
ifeq ($(BUILD_SHARED_LIBS), 1)
nix_tests += plugins.sh
endif
endif
tests/test-libstoreconsumer.sh.test: tests/test-libstoreconsumer/test-libstoreconsumer
tests/plugins.sh: tests/plugins/libplugintest.$(SO_EXT)
install-tests += $(foreach x, $(nix_tests), $(d)/$(x))
clean-files += \
@ -137,9 +150,4 @@ clean-files += \
test-deps += \
tests/common/vars-and-functions.sh \
tests/config.nix \
tests/test-libstoreconsumer/test-libstoreconsumer
ifeq ($(BUILD_SHARED_LIBS), 1)
test-deps += tests/plugins/libplugintest.$(SO_EXT)
endif
tests/config.nix