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 Nov 17, 2020
1 parent 18c40e0 commit 45c0a9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests/content-addressed/substitute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/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 --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 @@ -36,7 +36,8 @@ nix_tests = \
describe-stores.sh \
flakes.sh \
content-addressed/build.sh \
content-addressed/nix-copy.sh
content-addressed/nix-copy.sh \
content-addressed/substitute.sh
# parallel.sh
# build-remote-content-addressed-fixed.sh \
Expand Down

0 comments on commit 45c0a9b

Please sign in to comment.