From d1a648f9379fe2b4f6a3b2230889d520cae2f868 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 17 Oct 2026 17:30:15 +0900 Subject: cmd/hakurei/testsuite: migrate tests This runs much faster than the NixOS test suite, and is much more precise. This also uncovered a recent severe pipewire regression. This change removes all remaining deprecated nix code. Closes #22. Signed-off-by: Ophestra --- internal/workflows/Containerfile | 3 +++ internal/workflows/doc.go | 3 +++ internal/workflows/step.go | 12 ------------ internal/workflows/test.go | 22 ++++++++++++---------- 4 files changed, 18 insertions(+), 22 deletions(-) (limited to 'internal/workflows') diff --git a/internal/workflows/Containerfile b/internal/workflows/Containerfile index eb858831..82ce8820 100644 --- a/internal/workflows/Containerfile +++ b/internal/workflows/Containerfile @@ -8,13 +8,16 @@ RUN add-apt-repository -y ppa:savoury1/pipewire && \ acl \ sway \ xwayland \ + x11-xserver-utils \ xdg-dbus-proxy \ + libnotify-bin \ pipewire \ pipewire-pulse \ wireplumber- \ pulseaudio-utils \ foot \ xterm \ + grim \ fuse3 \ fsmark && \ apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/internal/workflows/doc.go b/internal/workflows/doc.go index 123bf7c1..e220ed67 100644 --- a/internal/workflows/doc.go +++ b/internal/workflows/doc.go @@ -38,6 +38,9 @@ On Alpine Linux, this is achieved by: # Use any other user for rootless mode. podman_user="act_runner" + # Required by cmd/hakurei test suite. + rc_ulimit="-r 49" + A symlink must then be created at /var/run/docker.sock pointing to the socket owned by the unprivileged daemon. This should be done in a /etc/local.d script. diff --git a/internal/workflows/step.go b/internal/workflows/step.go index 5175d4d5..3458c0ea 100644 --- a/internal/workflows/step.go +++ b/internal/workflows/step.go @@ -58,15 +58,3 @@ func newTestsuite(name, prefix string) Step { Run: prefix + "go run -tags=testsuite ./cmd/" + name, } } - -// newNixOSTest returns a step for running the named NixOS test. -func newNixOSTest(name string) Step { - return Step{ - Name: "Run NixOS test", - Run: "nix build " + - "--out-link result " + - "--print-out-paths " + - "--print-build-logs " + - "./cmd/hakurei/testsuite#checks.x86_64-linux." + name, - } -} diff --git a/internal/workflows/test.go b/internal/workflows/test.go index 5ca795c6..b0819916 100644 --- a/internal/workflows/test.go +++ b/internal/workflows/test.go @@ -7,25 +7,27 @@ var _ = (&Workflow{ On: []any{"push"}, Jobs: Map[Job]{ - {"hakurei-legacy", Job{ - Name: "Hakurei (legacy)", - On: "nix", + {"hakurei", Job{ + Name: "Hakurei", + On: "rosa", Steps: []Step{ checkout, - newNixOSTest("hakurei"), - newUploadArtifact("test output", "hakurei-vm-output"), + dist, + install, + newTestsuite("hakurei/testsuite", "unshare -n "), }, }}, - {"hakurei-race-legacy", Job{ - Name: "Hakurei (legacy with race instrument)", - On: "nix", + {"hakurei-race", Job{ + Name: "Hakurei (with race instrument)", + On: "rosa", Steps: []Step{ checkout, - newNixOSTest("race"), - newUploadArtifact("test output", "hakurei-race-vm-output"), + _dist, + install, + newTestsuite("hakurei/testsuite", "unshare -n "), }, }}, -- cgit v1.3.1