shrub/nix/ops/test/builder.sh

67 lines
1.3 KiB
Bash
Raw Normal View History

2019-03-05 03:43:53 +03:00
source $stdenv/setup
set -ex
cp -r $SHIP ./ship
chmod -R u+rw ./ship
$URBIT -d ./ship 2> urbit-output
2019-03-05 03:43:53 +03:00
tail -f urbit-output >&2 &
tailproc=$!
shutdown () {
if [ -e ./ship/.vere.lock ]
then kill $(< ./ship/.vere.lock) || true;
fi
kill "$tailproc" || true;
}
trap shutdown EXIT
2019-07-10 10:33:41 +03:00
herb ./ship -p hood -d '+hood/mass'
2019-03-05 03:43:53 +03:00
# Start the test app
herb ./ship -p hood -d '+hood/start %test'
2019-03-05 03:43:53 +03:00
# Run the %cores tests
herb ./ship -d '~& ~ ~& %start-test-cores ~'
herb ./ship -p test -d ':- %cores /'
herb ./ship -d '~& %finish-test-cores ~'
2019-03-05 03:43:53 +03:00
2019-07-10 10:33:41 +03:00
herb ./ship -p hood -d '+hood/mass'
2019-03-05 03:43:53 +03:00
# Run the %renders tests
herb ./ship -d '~& ~ ~& %start-test-renders ~'
herb ./ship -p test -d ':- %renders /'
herb ./ship -d '~& %finish-test-renders ~'
2019-03-05 03:43:53 +03:00
# Run the test generator
herb ./ship -d '+test, =seed `@uvI`(shaz %reproducible)' |
tee test-generator-output
2019-03-05 03:43:53 +03:00
2019-07-10 10:33:41 +03:00
herb ./ship -p hood -d '+hood/mass'
2019-03-05 03:43:53 +03:00
shutdown
# Collect output
cp urbit-output test-cores-output
cp urbit-output test-renders-output
rm urbit-output
sed -i '0,/start-test-renders/d' test-renders-output
sed -i '/finish-test-renders/,$d' test-renders-output
sed -i '0,/start-test-cores/d' test-cores-output
sed -i '/finish-test-cores/,$d' test-cores-output
mkdir $out
cp test-renders-output $out/renders
cp test-cores-output $out/cores
cp test-generator-output $out/generator
set +x