ci(ui-test): clean root-owned build artifacts so runner teardown succeeds #84
Reference in New Issue
Block a user
Delete Branch "feature/ci-ui-test-build-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Follow-up to #83. The post-merge
go-unitrun ondevelopmentwas markedfailed even though every test passed (
Job succeededin the log). Thereal cause was the runner teardown:
In host-mode the
ui-testjob runs as root, sovite(test:pwa),svelte-kitand Playwright writebuild/,.svelte-kit/,test-results/and
playwright-report/root-owned into the shared host workspace. Theact_runner(non-root) then can't remove them at teardown, whichintermittently fails whichever job inherits the dirty workspace — this time
go-uniton the #83 merge. No test failure; a pure infra false-negative.Fix
Add an
if: always()step at the end ofui-testthat removes thosegenerated dirs while the step still has root, after the artifact uploads.
The shared workspace is left clean for the runner's own teardown and for
later jobs, so the spurious cross-job failures stop.
Notes
node_moduleswas never the reported blocker (pnpm store/symlinks) so it is left alone.
--- FAILin anyjob, all end with
Job succeededfollowed by the sameunlinkatcleanuperror;
dev-deploy,fbs-codegenandintegrationwere green despitethe same cleanup line.
In host-mode the ui-test job runs as root, so vite (test:pwa), svelte-kit and Playwright write build/, .svelte-kit/, test-results/ and playwright-report/ root-owned into the shared host workspace. The act_runner (non-root) then cannot remove them at teardown ("unlinkat ui/frontend/build: permission denied"), which spuriously marks this or a sibling job that inherits the dirty workspace as failed — it hit go-unit on the #83 merge even though every test passed. Add an `if: always()` step that removes those generated dirs while the job still has root, after the artifact uploads. Keeps the shared workspace clean for the runner's own teardown and for later jobs.