aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2024-12-21 13:58:57 +0900
committerOphestra <cat@gensokyo.uk>2024-12-21 13:58:57 +0900
commitce04dd52ca0429b58b19b0a0b834891a069ea4b6 (patch)
tree47499b9e9d7d78c0110871910dac0dd55ede34be
parent3d042f49927055df60d739cc90f60fd5456c4dd0 (diff)
nix: background go test
Go test takes significant time. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--test.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/test.nix b/test.nix
index 7ec930ff..7f1eb0d2 100644
--- a/test.nix
+++ b/test.nix
@@ -153,9 +153,9 @@ nixosTest {
start_all()
machine.wait_for_unit("multi-user.target")
- # Run fortify Go tests outside of nix build:
+ # Run fortify Go tests outside of nix build in the background:
machine.succeed("rm -rf /tmp/src && cp -a '${self.packages.${system}.fortify.src}' /tmp/src")
- print(machine.succeed("fortify-fhs -c '(cd /tmp/src && go generate ./... && go test ./...)'"))
+ machine.succeed("fortify-fhs -c '(cd /tmp/src && go generate ./... && go test ./... && touch /tmp/success-gotest)' &> /tmp/gotest &")
# To check sway's version:
print(machine.succeed("sway --version"))
@@ -213,5 +213,10 @@ nixosTest {
# Print fortify runDir contents:
print(machine.succeed("find /run/user/1000/fortify"))
+
+ # Verify go test status:
+ machine.wait_for_file("/tmp/gotest")
+ print(machine.succeed("cat /tmp/gotest"))
+ machine.wait_for_file("/tmp/success-gotest")
'';
}