From 4109491469795692b0a7a996d35ababf238daca4 Mon Sep 17 00:00:00 2001 From: Vernon Stinebaker Date: Tue, 5 May 2026 14:35:45 +0800 Subject: [PATCH] build(test): make backend test entrypoint deterministic --- .github/workflows/ci.yml | 2 +- README.md | 6 +++--- build.zig | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5158e9..946bb27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: npm --prefix ui run build - name: Run unit tests - run: zig build test -Dbuild-ui=false --summary all 2>&1 | tee test-output.txt + run: zig build test -Dembed-ui=false -Dbuild-ui=false --summary all 2>&1 | tee test-output.txt - name: Run E2E tests if: runner.os == 'Linux' diff --git a/README.md b/README.md index 73f7c48..28eff4d 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ Local access chain: ### Build Prerequisites -- `npm` is required for `zig build` and `zig build test` because the Svelte UI is - built and embedded into the binary during the Zig build. +- `npm` is required for `zig build` and for any build that embeds the Svelte UI. +- Backend-only tests can run without UI assets via `zig build test -Dembed-ui=false -Dbuild-ui=false`. When these tools are missing, `nullhub` will try to install them automatically via available system package managers (`apt`, `dnf`, `yum`, `pacman`, `zypper`, @@ -124,7 +124,7 @@ optional `NULLTICKETS_TOKEN`. Backend: ```bash -zig build test +zig build test -Dembed-ui=false -Dbuild-ui=false --summary all ``` Frontend: diff --git a/build.zig b/build.zig index 54b11ac..7762e75 100644 --- a/build.zig +++ b/build.zig @@ -113,7 +113,7 @@ fn ensureUiBuildReady(b: *std.Build) void { fn ensureUiBuildExists() void { if (!pathExists("ui/build")) { - std.debug.panic("embedded UI assets are missing; run `npm --prefix ui run build` or build with -Dbuild-ui=true", .{}); + std.debug.panic("embedded UI assets are missing; run `npm --prefix ui run build`, build with -Dbuild-ui=true, or disable embedding with -Dembed-ui=false for backend-only tests", .{}); } }