mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 03:00:15 +03:00
build: simplify make test and re-enable on darwin ci for testing
This commit is contained in:
parent
fada33dfe6
commit
50f66ce431
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ release:
|
||||
sh/release
|
||||
|
||||
test:
|
||||
sh/test
|
||||
nix-build -A urbit-tests --no-out-link
|
||||
|
||||
pills:
|
||||
sh/update-solid-pill
|
||||
|
@ -49,7 +49,7 @@ let
|
||||
# Encode `oid` and `size` into a download operation per:
|
||||
# https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
|
||||
#
|
||||
# This is done using toJSON to avoid bash quotation issuthe configurationes.
|
||||
# This is done using toJSON to avoid bash quotation issues.
|
||||
downloadPayload = builtins.toJSON {
|
||||
operation = "download";
|
||||
objects = [ pointer ];
|
||||
|
@ -2,12 +2,10 @@
|
||||
|
||||
{ urbit, herb, arvo ? null, pill, ship ? "bus" }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "test-${ship}";
|
||||
|
||||
stdenvNoCC.mkDerivation {name = "test-${ship}";
|
||||
buildInputs = [ cacert urbit herb ];
|
||||
|
||||
phases = [ "buildPhase" "installPhase " ];
|
||||
phases = [ "buildPhase" "installPhase" "checkPhase" ];
|
||||
|
||||
buildPhase = ''
|
||||
set -xeuo pipefail
|
||||
@ -100,5 +98,40 @@ stdenvNoCC.mkDerivation {
|
||||
cp -r test-output-* $out/
|
||||
'';
|
||||
|
||||
meta = { platforms = [ "x86_64-linux" ]; };
|
||||
checkPhase = ''
|
||||
hdr () {
|
||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
||||
echo ==== $1 ====
|
||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
||||
}
|
||||
|
||||
for f in $(find "$out/" -type f); do
|
||||
hdr "$(basename $f)"
|
||||
cat "$f"
|
||||
done
|
||||
|
||||
fail=0
|
||||
|
||||
for f in $(find "$out/" -type f); do
|
||||
if egrep "((FAILED|CRASHED)|(ford|warn):) " $f >/dev/null; then
|
||||
if [[ $fail -eq 0 ]]; then
|
||||
hdr "Test Failures"
|
||||
fi
|
||||
|
||||
echo "ERROR Test failure in $(basename $f)"
|
||||
|
||||
((fail++))
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $fail -eq 0 ]]; then
|
||||
hdr "Success"
|
||||
fi
|
||||
|
||||
exit "$fail"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
40
sh/test
40
sh/test
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
pkg="$(nix-build -A urbit-tests --no-out-link "$@")"
|
||||
|
||||
hdr () {
|
||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
||||
echo ==== $1 ====
|
||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
||||
}
|
||||
|
||||
for f in $(find "$pkg/" -type f)
|
||||
do
|
||||
hdr "$(basename $f)"
|
||||
cat "$f"
|
||||
done
|
||||
|
||||
fail=0
|
||||
|
||||
for f in $(find "$pkg/" -type f)
|
||||
do
|
||||
if egrep "((FAILED|CRASHED)|(ford|warn):) " $f >/dev/null
|
||||
then
|
||||
if [[ $fail -eq 0 ]]
|
||||
then
|
||||
hdr "Test Failures"
|
||||
fi
|
||||
|
||||
echo "ERROR Test failure in $(basename $f)"
|
||||
((fail++))
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $fail -eq 0 ]]
|
||||
then
|
||||
hdr "Success"
|
||||
fi
|
||||
|
||||
exit "$fail"
|
Loading…
Reference in New Issue
Block a user