From 287fb4a28baa3ef7cb4b1dcbb23f928abd6fc0f3 Mon Sep 17 00:00:00 2001 From: Stephan Maka Date: Sat, 20 Apr 2019 01:17:39 +0200 Subject: [PATCH] windows tests: capture failure, shutdown vm cleanly --- artiq/windows/run-test.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/windows/run-test.nix b/artiq/windows/run-test.nix index 8afa2fa..f775d95 100644 --- a/artiq/windows/run-test.nix +++ b/artiq/windows/run-test.nix @@ -60,7 +60,8 @@ stdenv.mkDerivation { # Allow tests to run for 2 minutes ${ssh "shutdown -s -t ${toString testTimeout}"} - ${ssh "anaconda\\scripts\\activate ${condaEnv} && ${testCommand}"} + FAIL=n + ${ssh "anaconda\\scripts\\activate ${condaEnv} && ${testCommand}"} || FAIL=y # Abort timeouted shutdown ${ssh "shutdown -a"} @@ -68,6 +69,8 @@ stdenv.mkDerivation { ${ssh "shutdown -p -f"} wait + [ "\\$FAIL" = "y" ] && exit 1 + EOF chmod a+x $out/bin/run.sh '';