From 8ddc826bd02ff0d58123e1af5de2f48ae0dbc7c9 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 1 Oct 2026 22:34:51 +0900 Subject: test/sandbox: migrate tests This benefits even more than the cmd/sharefs test suite, the slow python-based test script was a major bottleneck. Replacing the nix-represented test cases with compound literals also significantly increases readability. Signed-off-by: Ophestra --- internal/workflows/step.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'internal/workflows/step.go') diff --git a/internal/workflows/step.go b/internal/workflows/step.go index 219ed78b..6d715196 100644 --- a/internal/workflows/step.go +++ b/internal/workflows/step.go @@ -55,9 +55,21 @@ func newCIRequest(display, name, id string) Step { var install = Step{ Name: "Install hakurei", Run: "HAKUREI_VERSION=\"$(cat cmd/dist/VERSION)-${{ steps.dist.outputs.rev }}\" && " + - "tar xf \"result/hakurei-$HAKUREI_VERSION-amd64.tar.gz\" && " + - "\"./hakurei-$HAKUREI_VERSION-amd64/install.sh\" && " + - "sudo -u ubuntu hakurei version", + "tar xf result/hakurei-$HAKUREI_VERSION*-amd64.tar.gz && " + + "./hakurei-$HAKUREI_VERSION*-amd64/install.sh && " + + "sudo -u ubuntu hakurei version && " + + "echo 'Defaults closefrom_override' > " + + "/etc/sudoers.d/closefrom_override && " + + "mkdir /var/empty", +} + +// newTestsuite returns a step for running an integration test suite. +func newTestsuite(name, prefix string) Step { + return Step{ + Name: "Compile and run test suite", + Run: prefix + "rm -rf result && " + + "go run -tags=testsuite ./test/" + name + " ubuntu", + } } // newNixOSTest returns a step for running the named NixOS test. -- cgit v1.3.1