ci: fix scheduler test in CI + gate image publish on tests#13
Merged
Conversation
- scheduler.test.js imported scheduler.js (→ db.js, which mkdirs DATA_DIR at load); in CI that's /data and mkdir is denied (EACCES), crashing the test file. Set DATA_DIR to a temp dir before importing, matching settings.test.js. (Passed locally only because /data was writable here.) - Gate the publish workflow on a verify job (server tests + client build) so a red test never ships an image — previously CI and Publish were independent workflows and the image published even when CI failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the red CI on
mainand the "it published anyway" surprise.Why CI failed
scheduler.test.jsimportsscheduler.js→db.js, which runsfs.mkdirSync(DATA_DIR)at load. In CI that defaults to/data, which the runner can't create →EACCES, crashing the file. (It passed locally only because/datahappened to be writable.) Fix: setDATA_DIRto a temp dir before importing, exactly likesettings.test.js.Why it published despite the failure
ci.yml(tests) andrelease.yml(publish) are independent workflows on the same push — publish builds the image and doesn't run the tests, so it succeeded on its own. Now the publish jobneedsaverifyjob (server tests + client build), so a red test blocks the image from shipping.Note: the previously-published
:edgeis actually fine — the failure was test-environment-only (the running container's/datais a writable volume), not a product bug.Test plan
cd server && node --test→ 76/76verifyruns beforepublishGenerated by Claude Code