mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
Update tests
This commit is contained in:
parent
d749f5132b
commit
0588d72286
1 changed files with 15 additions and 20 deletions
|
@ -31,7 +31,7 @@ cat > $flake1Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake1";
|
name = "flake1";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
description = "Bla bla";
|
description = "Bla bla";
|
||||||
|
|
||||||
|
@ -50,14 +50,12 @@ cat > $flake2Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake2";
|
name = "flake2";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = [ "flake1" ];
|
|
||||||
|
|
||||||
description = "Fnord";
|
description = "Fnord";
|
||||||
|
|
||||||
outputs = inputs: rec {
|
outputs = { self, flake1 }: rec {
|
||||||
packages.bar = inputs.flake1.packages.foo;
|
packages.bar = flake1.packages.foo;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
@ -69,14 +67,12 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = [ "flake2" ];
|
|
||||||
|
|
||||||
description = "Fnord";
|
description = "Fnord";
|
||||||
|
|
||||||
outputs = inputs: rec {
|
outputs = { self, flake2 }: rec {
|
||||||
packages.xyzzy = inputs.flake2.packages.bar;
|
packages.xyzzy = flake2.packages.bar;
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
xyzzy = packages.xyzzy;
|
xyzzy = packages.xyzzy;
|
||||||
|
@ -189,15 +185,13 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = [ "flake1" "flake2" ];
|
|
||||||
|
|
||||||
description = "Fnord";
|
description = "Fnord";
|
||||||
|
|
||||||
outputs = inputs: rec {
|
outputs = { self, flake1, flake2 }: rec {
|
||||||
packages.xyzzy = inputs.flake2.packages.bar;
|
packages.xyzzy = flake2.packages.bar;
|
||||||
packages.sth = inputs.flake1.packages.foo;
|
packages.sth = flake1.packages.foo;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
@ -216,7 +210,7 @@ git -C $flake3Dir add flake.lock
|
||||||
git -C $flake3Dir commit -m 'Add lockfile'
|
git -C $flake3Dir commit -m 'Add lockfile'
|
||||||
|
|
||||||
# Unsupported editions should be an error.
|
# Unsupported editions should be an error.
|
||||||
sed -i $flake3Dir/flake.nix -e s/201906/201909/
|
sed -i $flake3Dir/flake.nix -e s/201909/201912/
|
||||||
nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth 2>&1 | grep 'unsupported edition'
|
nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:sth 2>&1 | grep 'unsupported edition'
|
||||||
|
|
||||||
# Test whether registry caching works.
|
# Test whether registry caching works.
|
||||||
|
@ -244,7 +238,7 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = [ "flake1" "flake2" ];
|
inputs = [ "flake1" "flake2" ];
|
||||||
|
|
||||||
|
@ -310,7 +304,7 @@ cat > $flake3Dir/flake.nix <<EOF
|
||||||
{
|
{
|
||||||
name = "flake3";
|
name = "flake3";
|
||||||
|
|
||||||
edition = 201906;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = [ "flake1" "flake2" ];
|
inputs = [ "flake1" "flake2" ];
|
||||||
|
|
||||||
|
@ -356,4 +350,5 @@ nix flake remove --flake-registry $registry flake1
|
||||||
(cd $flake7Dir && nix flake init)
|
(cd $flake7Dir && nix flake init)
|
||||||
nix flake --flake-registry $registry check $flake3Dir
|
nix flake --flake-registry $registry check $flake3Dir
|
||||||
|
|
||||||
|
rm -rf $TEST_ROOT/flake1-v2
|
||||||
nix flake clone --flake-registry $registry flake1 $TEST_ROOT/flake1-v2
|
nix flake clone --flake-registry $registry flake1 $TEST_ROOT/flake1-v2
|
||||||
|
|
Loading…
Reference in a new issue