Skip to content

ci: stop swallowing test failures in Build + CI workflows#212

Open
JayDS22 wants to merge 2 commits into
accordproject:mainfrom
JayDS22:jay/ci/dont-swallow-test-failures
Open

ci: stop swallowing test failures in Build + CI workflows#212
JayDS22 wants to merge 2 commits into
accordproject:mainfrom
JayDS22:jay/ci/dont-swallow-test-failures

Conversation

@JayDS22

@JayDS22 JayDS22 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Both .github/workflows/main.yml and .github/workflows/build.yml ran npm test || echo "No tests configured". The || echo makes the shell exit 0 whenever the test suite fails, so a red test run reports success and the failing job goes green.

Why this matters

build.yml runs the tests across a Node-version × OS matrix (Node 22.x + 24.x on ubuntu/macos/windows, six cells). Every one of those cells has been reporting success on failing tests. If a real test regression landed on main, no cell would fail the build.

What this PR does

Drops the || echo "No tests configured" fallback on both workflow files. npm test at the repo root delegates to cd server && npm run test, which is defined and passes locally on the current main. There is no scenario where the safety net is doing useful work.

Validation

  • Both workflows run npm test at the repo root
  • Root npm test maps to cd server && npm run test, currently 121 tests passing across 9 suites
  • No test infra changes; only the exit-code masking is removed

Author Checklist

  • DCO sign-off provided
  • Two-line change, no code touched
  • Root npm test verified to run and pass on current main

@JayDS22

JayDS22 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator Author

Heads-up on the two failing checks (build and Unit Tests 24.x macos-latest): they are not caused by this PR. Root npm ci does not populate server/node_modules (no workspaces field on the repo), so jest was never installed on the runner despite being declared in server/package.json. The || echo "No tests configured" line this PR removes was masking that failure on main for the last 12 days.

Fix is queued as #215 which adds cd server && npm ci to build.yml and main.yml (same pattern pr_request.yml's test job already uses). CI on #215 is 13/13 green. Once #215 lands and this PR rebases (or its CI re-runs against the fresh base), the failing checks here should clear.

@github-actions github-actions Bot added the maintainer-engaged A maintainer has commented or reviewed this item label Jul 19, 2026
@niallroche
niallroche self-requested a review July 20, 2026 11:34
@niallroche

Copy link
Copy Markdown
Contributor

Good catch Jay,

This is important to get right before we add anything else, can you resolve the build issues and I'll merge

niallroche pushed a commit that referenced this pull request Jul 20, 2026
The Build (`build.yml`) and CI (`main.yml`) workflows ran `npm ci`
at the repo root and then `npm test`, which delegates to
`cd server && npm run test`. That test script exec's
`node_modules/.bin/jest` inside `server/` — but the root `npm ci`
only installs the root package.json's deps, so
`server/node_modules/` was empty on the runner and jest was never
present.

The failure only surfaced now because the same `npm test` line
carried a `|| echo "No tests configured"` fallback (removed in
#212), which made the test step exit 0 even though jest failed
to resolve. The macos-latest cell of the Build matrix has been
failing silently on main for the last 12+ days for this same
reason.

The `pr_request.yml` "test" job already does the two-step install
(`npm ci` at root, then `npm ci` inside `server/`), and its test
job passes on every PR. This PR ports that pattern to `build.yml`
and `main.yml` so their test steps have the same dependency state.

Publish job in `build.yml` is unchanged: it only runs
`npm run build --if-present` and does not exercise the server test
suite, so it does not need server-side install.

Signed-off-by: Jay Guwalani <guwalanijj@gmail.com>
Both `.github/workflows/main.yml` and `.github/workflows/build.yml` ran
`npm test || echo "No tests configured"`. The `|| echo` makes the shell
exit 0 whenever the test suite fails, so a red test run reports success
and the failing job goes green. The Node-version + OS build matrix in
`build.yml` (Node 22.x/24.x on ubuntu/macos/windows) magnifies the
blindspot to six matrix cells at a time.

`npm test` at the repo root delegates to `cd server && npm run test`
which is defined and passes locally; there is no scenario where the
safety net is doing useful work.

Dropping the `|| echo` on both workflows so a failing test suite fails
the job.

Signed-off-by: Jay Guwalani <guwalanijj@gmail.com>
@JayDS22
JayDS22 force-pushed the jay/ci/dont-swallow-test-failures branch from aec45a6 to 7705a48 Compare July 21, 2026 02:42
@JayDS22

JayDS22 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @niallroche. Rebased on post-#215 main so the server-install fix is in the base now. CI running fresh, should clear green this time. Ready for merge whenever.

Previously `server/npm test` was:
  node --experimental-vm-modules node_modules/.bin/jest

On Windows runners, `node_modules/.bin/jest` is a Git-Bash shell-script
wrapper. Passing it as an entry point to `node` fails with:
  SyntaxError: missing ) after argument list
      basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

because Node tries to parse the shell script as JavaScript. macOS and
Linux runners had it working only because their `.bin/jest` is a symlink
to the actual JS file.

Point directly at `node_modules/jest/bin/jest.js` (the JS entry the
shell wrapper eventually delegates to). Same runtime behavior on all
three OSes, no more wrapper confusion.

This is the actual failure that the rest of this PR (removing
`|| echo "No tests configured"`) surfaced on the Windows matrix cells.
It was silently swallowed on main for the last 12+ days.

Signed-off-by: Jay Guwalani <guwalanijj@gmail.com>
@JayDS22

JayDS22 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed the actual Windows fix. server/npm test was invoking jest through its shell-script wrapper (node_modules/.bin/jest), which Windows runners can not parse as JS. Now points directly at node_modules/jest/bin/jest.js, which is the JS entry the wrapper delegates to. Same behavior on macOS and Linux (which had a symlink), works on Windows. 108/108 local tests pass. CI running fresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-engaged A maintainer has commented or reviewed this item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants