aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2023-01-31 12:49:33 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2023-05-08 12:43:56 +0200
commit869fb1a2f6b8374feacb5ed730e0a0f6cbb195c4 (patch)
treeb363ac6d801a560c00dd8a799d9885b41fd12d86 /tests
parentcf8effdae25bac889533cff86d637512f4f74bf8 (diff)
tests/post-hook: test to see if all outputs are passed
fe5509df caused only wanted outputs to be passed to the post-build-hook, which resulted in paths being built without ever going into the hook. This commit adds a (currently failing) test for this.
Diffstat (limited to 'tests')
-rw-r--r--tests/post-hook.sh4
-rwxr-xr-xtests/push-to-store-old.sh6
-rwxr-xr-xtests/push-to-store.sh6
3 files changed, 14 insertions, 2 deletions
diff --git a/tests/post-hook.sh b/tests/post-hook.sh
index 0266eb15d..8b7838058 100644
--- a/tests/post-hook.sh
+++ b/tests/post-hook.sh
@@ -17,6 +17,9 @@ fi
# Build the dependencies and push them to the remote store.
nix-build -o $TEST_ROOT/result dependencies.nix --post-build-hook "$pushToStore"
+# See if all outputs are passed to the post-build hook by only specifying one
+export BUILD_HOOK_ONLY_OUT_PATHS=1
+nix-build -o $TEST_ROOT/result-mult multiple-outputs.nix -A a.first --post-build-hook "$pushToStore"
clearStore
@@ -24,3 +27,4 @@ clearStore
# closure of what we've just built.
nix copy --from "$REMOTE_STORE" --no-require-sigs -f dependencies.nix
nix copy --from "$REMOTE_STORE" --no-require-sigs -f dependencies.nix input1_drv
+nix copy --from "$REMOTE_STORE" --no-require-sigs -f multiple-outputs.nix a^second
diff --git a/tests/push-to-store-old.sh b/tests/push-to-store-old.sh
index b1495c9e2..4187958b2 100755
--- a/tests/push-to-store-old.sh
+++ b/tests/push-to-store-old.sh
@@ -7,4 +7,8 @@ set -e
[ -n "$DRV_PATH" ]
echo Pushing "$OUT_PATHS" to "$REMOTE_STORE"
-printf "%s" "$DRV_PATH" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+if [ -n "$BUILD_HOOK_ONLY_OUT_PATHS" ]; then
+ printf "%s" "$OUT_PATHS" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+else
+ printf "%s" "$DRV_PATH" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+fi
diff --git a/tests/push-to-store.sh b/tests/push-to-store.sh
index 0b090e1b3..9e4e475e0 100755
--- a/tests/push-to-store.sh
+++ b/tests/push-to-store.sh
@@ -7,4 +7,8 @@ set -e
[ -n "$DRV_PATH" ]
echo Pushing "$OUT_PATHS" to "$REMOTE_STORE"
-printf "%s" "$DRV_PATH"^'*' | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+if [ -n "$BUILD_HOOK_ONLY_OUT_PATHS" ]; then
+ printf "%s" "$OUT_PATHS" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+else
+ printf "%s" "$DRV_PATH"^'*' | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
+fi