Skip to content

Commit

Permalink
Github prefetch path test
Browse files Browse the repository at this point in the history
  • Loading branch information
refnil committed Sep 25, 2021
1 parent 01dcbc7 commit 8d37a17
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/github/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ pkgs.runCommand "test"
(echo "Mismatched sources.json"; \
echo "Reference: tests/expected/niv-init.json"; \
exit 1)
niv_output_path=$(nix eval --json '(import ./nix/sources.nix).niv.outPath' | jq -r)
nix-store --delete $niv_output_path
echo "*** ok."
Expand Down Expand Up @@ -113,7 +114,20 @@ pkgs.runCommand "test"
echo -e "\n*** niv update niv"
cat ${./data/repos/nmattia/niv/commits.json} | jq -j '.[0] | .sha' > mock/repos/nmattia/niv/commits/master
echo -n "Check that the expected store path does not exist before niv update ($niv_output_path): "
test ! -e $niv_output_path; echo OK
niv update niv
echo -n "Check that the expected store path exist after niv update ($niv_output_path): "
test -e $niv_output_path; echo OK
new_niv_output_path=$(nix eval --json '(import ./nix/sources.nix).niv.outPath' | jq -r)
echo -n "Check that the resulting outPath is the one that we expect ($niv_output_path): "
test $niv_output_path = $new_niv_output_path; echo OK
echo -n "niv.rev == ${niv_HEAD} (HEAD): "
cat nix/sources.json | jq -e '.niv | .rev == "${niv_HEAD}"'
echo -e "*** ok."
Expand Down

0 comments on commit 8d37a17

Please sign in to comment.