Skip to content

Commit

Permalink
Add a test for the remote caching of CA derivations
Browse files Browse the repository at this point in the history
  • Loading branch information
thufschmitt committed Dec 1, 2020
1 parent 6c9e183 commit e10741c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions tests/ca/substitute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

# Ensure that binary substitution works properly with ca derivations

source common.sh

export REMOTE_STORE=file://$TEST_ROOT/binary_cache

buildDrvs () {
nix --experimental-features 'nix-command ca-derivations ca-references' build --file ./content-addressed.nix -L --no-link "$@"
}

# Populate the remote cache
buildDrvs --post-build-hook ../push-to-store.sh

# Restart the build on an empty store, ensuring that we don't build
clearStore
buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs|& \
(! grep -q Building)

3 changes: 2 additions & 1 deletion tests/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ nix_tests = \
flakes.sh \
build.sh \
ca/build.sh \
ca/nix-copy.sh
ca/nix-copy.sh \
ca/substitute.sh
# parallel.sh
# build-remote-content-addressed-fixed.sh \
Expand Down

0 comments on commit e10741c

Please sign in to comment.