mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 14:31:55 +03:00
optimize tests for examples
This commit is contained in:
parent
60d9308a7b
commit
5f8841c794
@ -19,6 +19,7 @@
|
||||
source = src;
|
||||
})
|
||||
// {
|
||||
checks = self.packages;
|
||||
# checks are too expensive
|
||||
# checks = self.packages;
|
||||
};
|
||||
}
|
||||
|
@ -25,6 +25,6 @@
|
||||
];
|
||||
})
|
||||
// {
|
||||
checks = self.packages;
|
||||
checks.x86_64-linux.ripgrep = self.packages.x86_64-linux.ripgrep;
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
self,
|
||||
lib,
|
||||
async,
|
||||
bash,
|
||||
coreutils,
|
||||
git,
|
||||
nix,
|
||||
@ -13,6 +15,8 @@
|
||||
in
|
||||
utils.writePureShellScript
|
||||
[
|
||||
async
|
||||
bash
|
||||
coreutils
|
||||
git
|
||||
nix
|
||||
@ -24,16 +28,27 @@ in
|
||||
examples=$1
|
||||
fi
|
||||
|
||||
S=$(mktemp)
|
||||
async -s=$S server --start -j$(nproc)
|
||||
sleep 1
|
||||
|
||||
for dir in $examples; do
|
||||
echo -e "\ntesting example for $dir"
|
||||
mkdir tmp
|
||||
cp ${examples}/$dir/* ./tmp/
|
||||
chmod -R +w ./tmp
|
||||
cd ./tmp
|
||||
nix flake lock --override-input dream2nix ${../../.}
|
||||
nix run .#resolveImpure
|
||||
nix flake check
|
||||
cd -
|
||||
rm -r tmp
|
||||
async -s=$S cmd -- bash -c "
|
||||
echo -e \"\ntesting example for $dir\"
|
||||
tmp=\$(mktemp -d)
|
||||
echo \"tempdir: \$tmp\"
|
||||
mkdir \$tmp
|
||||
cp ${examples}/$dir/* \$tmp/
|
||||
chmod -R +w \$tmp
|
||||
cd \$tmp
|
||||
nix flake lock --override-input dream2nix ${../../.}
|
||||
nix run .#resolveImpure
|
||||
nix flake check
|
||||
cd -
|
||||
rm -r \$tmp
|
||||
"
|
||||
done
|
||||
|
||||
async -s=$S wait
|
||||
rm $S
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user