1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 20:46:01 +01:00

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 eb68454be6)
This commit is contained in:
Théophane Hufschmitt 2023-10-04 17:10:54 +02:00 committed by John Ericson
parent e813f9c4cd
commit 196670af76
2 changed files with 12 additions and 2 deletions

View file

@ -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;

View file

@ -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