Fix unit tests after agentic-workflow modularisation#1932
Conversation
…chitecture Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/42ee60fc-d0ce-49f3-be62-2e60ef00dd7e Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: testing,size-xl Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request) |
There was a problem hiding this comment.
Pull request overview
Updates unit tests to reflect the new modular agentic-workflow architecture where key rules live in imported bounded-context prompt modules under .github/prompts/, so assertions validate the effective prompt (workflow body + imports) rather than only the workflow body.
Changes:
- Introduce
readWorkflowWithImports()helper and migrate multiple tests to validate against the effective prompt surface. - Replace brittle prose-match assertions with import-based structural checks for concerns moved into shared prompt modules.
- Mark removed/obsolete pre-modular concepts as skipped legacy tests to preserve contract history without failing CI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/workflow-architecture.test.ts | Updates workflow contract assertions to read effective prompt and reflects modularized concerns; adds prompt-module existence checks. |
| tests/scb-mcp-integration.test.ts | Reads effective prompt for SCB safety guidance now defined in shared modules. |
| tests/network-diagnostics.test.ts | Reads effective prompt for MCP health-gate + noop policy rules now defined in shared modules; updates diagnostics assertions accordingly. |
| tests/helpers/workflow-imports.ts | Adds helper to resolve workflow imports: and concatenate workflow + module content for effective-prompt assertions. |
| tests/agentic-workflow-mcp-queries.test.ts | Migrates MCP query-pattern assertions to effective prompt and replaces legacy shared-pattern assumptions with prompt-module checks. |
| const __dirname = path.dirname(__filename); | ||
|
|
||
| const WORKFLOWS_DIR = path.join(__dirname, '..', '.github', 'workflows'); | ||
| const AW_DIR = path.join(__dirname, '..', '.github', 'aw'); |
There was a problem hiding this comment.
AW_DIR is now declared but never used. With noUnusedLocals enabled and CI running tsc --project tsconfig.scripts.json --noEmit, this will fail type-checking. Remove AW_DIR or reintroduce a use for it.
| const AW_DIR = path.join(__dirname, '..', '.github', 'aw'); |
| const __dirname = path.dirname(__filename); | ||
|
|
||
| const WORKFLOWS_DIR = path.join(__dirname, '..', '.github', 'workflows'); | ||
| const AW_DIR = path.join(__dirname, '..', '.github', 'aw'); |
There was a problem hiding this comment.
AW_DIR is declared but never used. With noUnusedLocals enabled in tsconfig.scripts.json (and enforced in CI), this will fail type-checking. Remove the constant or use it (e.g., in the legacy .github/aw assertions).
| const AW_DIR = path.join(__dirname, '..', '.github', 'aw'); |
Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/920c3e4b-b863-4825-89be-df176ffaba3e Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…cture Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/bbb4e044-4126-40ea-9382-ac6cacbcb049 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
What changed
AW_DIR/REQUIRED_SKILLS/TRANSLATION_REQUIRED_SKILLSflagged bytsc --noEmitit.skip(... LEGACY)tests intests/workflow-architecture.test.tsthat only existed to document the pre-modular architecture:EXISTING=$(ls …)dedup bash snippetsearch_anforandenminister-response referenceSHARED_PROMPT_PATTERNS.mdskill inventorypolitical-analysis.md/stakeholder-perspectives.mdprompt referencesfix-analysis-references.tswiringgenerate-news-enhanced.tswiringvalidate-file-ownership.tswiring// LEGACY: …comments that document the architectural transition they supersede (kept — these are context for the live assertion, not skipped stubs)tests/agentic-workflow-mcp-queries.test.ts,tests/network-diagnostics.test.ts,tests/scb-mcp-integration.test.tshad no skipped tests to purgenpx tsc --project tsconfig.scripts.json --noEmit— clean ✅npm test— 4324 passed / 0 skipped (was 4324 passed / 16 skipped) ✅npm run lint— 0 errors (pre-existing warnings unchanged) ✅