Skip to content

ci: install worker deps before discord unit tests - #26

Merged
rz1989s merged 1 commit into
mainfrom
fix/discord-drift-missing-install
Sep 23, 2026
Merged

rz1989s merged 1 commit into
mainfrom
fix/discord-drift-missing-install

Conversation

@rz1989s

@rz1989s rz1989s commented Sep 23, 2026

Copy link
Copy Markdown
Member

Root cause

discord-drift has been red on every scheduled run since the worker tests landed (Sep 7, 14, 21 — e.g. run 35596151629). The failure is not Discord drift:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'discord-interactions'
imported from discord/worker/src/index.js

The Unit tests step runs node --test from discord/, which also discovers worker/test/. handlers.test.js imports ../src/index.js, which needs the worker's discord-interactions dependency — but the workflow never installs it, so the file dies at load and the job exits 1. The Alert mod-log on drift step then posts a misleading "drift detected" message to the mod log every week.

Fix

Add npm ci in discord/worker before the unit tests. Nothing else changes.

Validation

  • Local repro on main: 62 pass / 1 fail (handlers.test.js load failure) — matches CI exactly.
  • With this change: 73/73 pass — the 11 worker tests that were crashing at load now actually run.
  • workflow_dispatch run on this branch:

Note: once this merges, the next scheduled run (Mondays 06:00 UTC) exercises the real drift check (verify.js + secrets). If that fails, it's genuine drift — the alert step finally means what it says.

The Unit tests step runs node --test from discord/, which discovers
worker/test/ too. handlers.test.js imports the worker's
discord-interactions dependency, so without an install step the file
fails to load and the weekly run has been red since the worker tests
landed. Local run with this change: 73/73 pass.
@rz1989s

rz1989s commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

Validated end-to-end via workflow_dispatch on this branch: run 35809018437 — all steps green. checkout@v7 / setup-node@v7 (from #10 / #16) both ran clean, unit tests 73/73, and the real drift check passed, so there is no actual server drift — the weekly reds were purely the missing install step.

@rz1989s
rz1989s merged commit 8adb355 into main Sep 23, 2026
1 check passed
@rz1989s
rz1989s deleted the fix/discord-drift-missing-install branch September 23, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant