optimize tests for examples

This commit is contained in:
DavHau 2022-04-23 15:09:55 +02:00
parent 60d9308a7b
commit 5f8841c794
3 changed files with 28 additions and 12 deletions

View File

@ -19,6 +19,7 @@
source = src; source = src;
}) })
// { // {
checks = self.packages; # checks are too expensive
# checks = self.packages;
}; };
} }

View File

@ -25,6 +25,6 @@
]; ];
}) })
// { // {
checks = self.packages; checks.x86_64-linux.ripgrep = self.packages.x86_64-linux.ripgrep;
}; };
} }

View File

@ -1,6 +1,8 @@
{ {
self, self,
lib, lib,
async,
bash,
coreutils, coreutils,
git, git,
nix, nix,
@ -13,6 +15,8 @@
in in
utils.writePureShellScript utils.writePureShellScript
[ [
async
bash
coreutils coreutils
git git
nix nix
@ -24,16 +28,27 @@ in
examples=$1 examples=$1
fi fi
S=$(mktemp)
async -s=$S server --start -j$(nproc)
sleep 1
for dir in $examples; do for dir in $examples; do
echo -e "\ntesting example for $dir" async -s=$S cmd -- bash -c "
mkdir tmp echo -e \"\ntesting example for $dir\"
cp ${examples}/$dir/* ./tmp/ tmp=\$(mktemp -d)
chmod -R +w ./tmp echo \"tempdir: \$tmp\"
cd ./tmp mkdir \$tmp
nix flake lock --override-input dream2nix ${../../.} cp ${examples}/$dir/* \$tmp/
nix run .#resolveImpure chmod -R +w \$tmp
nix flake check cd \$tmp
cd - nix flake lock --override-input dream2nix ${../../.}
rm -r tmp nix run .#resolveImpure
nix flake check
cd -
rm -r \$tmp
"
done done
async -s=$S wait
rm $S
'' ''