tests/nixpkgs-fetch: cross-check with version-info.toml
This commit is contained in:
parent
43a7e6f829
commit
753b1cd663
1 changed files with 10 additions and 0 deletions
|
|
@ -35,6 +35,7 @@
|
|||
# nix-instantiate --eval nixpkgs.nix --attr outPath --option experimental-features ''
|
||||
|
||||
let
|
||||
version-info = lib.importTOML ../version-info.toml;
|
||||
flake-input = self.inputs.nixpkgs.sourceInfo;
|
||||
pinned-input = import ../nixpkgs.nix;
|
||||
in
|
||||
|
|
@ -47,6 +48,8 @@ linkFarmFromDrvs "nixpkgs-fetch-test" [
|
|||
strictDeps = true;
|
||||
|
||||
hasPrimop = builtins ? fetchTree;
|
||||
versionInfo = version-info;
|
||||
|
||||
expected = flake-input;
|
||||
actual = pinned-input;
|
||||
|
||||
|
|
@ -73,6 +76,13 @@ linkFarmFromDrvs "nixpkgs-fetch-test" [
|
|||
exit 1
|
||||
fi
|
||||
|
||||
expectedRev=$(jq --raw-output .expectedAttrs.rev "$NIX_ATTRS_JSON_FILE")
|
||||
versionInfoRev=$(jq --raw-output .versionInfo.nixpkgs_rev "$NIX_ATTRS_JSON_FILE")
|
||||
[ "$expectedRev" = "$versionInfoRev" ] || {
|
||||
echo "Expected version-info nixpkgs_rev '$versionInfoRev' to be '$expectedRev'" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
mkdir "$out"
|
||||
jq --sort-keys .expectedAttrs "$NIX_ATTRS_JSON_FILE" > "$out/expected.json"
|
||||
jq --sort-keys .actualAttrs "$NIX_ATTRS_JSON_FILE" > "$out/actual.json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue