Skip to content

test(network-diagnostics): align tests with shared news-prewarm composite action#2009

Merged
pethers merged 1 commit intomainfrom
copilot/fix-unit-test-failures
Apr 26, 2026
Merged

test(network-diagnostics): align tests with shared news-prewarm composite action#2009
pethers merged 1 commit intomainfrom
copilot/fix-unit-test-failures

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

14 assertions in tests/network-diagnostics.test.ts failed after PR #2008 extracted the inline pre-flight/pre-warm YAML from every news-*.md workflow into the shared composite action .github/actions/news-prewarm/action.yml. The tests still grepped each workflow file for literals (Pre-flight external endpoint reachability check, DNS Resolution Tests, …) that now live only in the action.

Test-only change — workflows and the action are correct as merged.

Changes — tests/network-diagnostics.test.ts

  • New constants NEWS_PREWARM_ACTION and NEWS_PREWARM_USES_REF to point at the shared action.
  • Pre-flight External Reachability Check — assert the action exists, uses the clarified step name (not the legacy Network and MCP diagnostics), carries the canonical diagnostics content (DNS / HTTPS / MCP tool count), and probes every entry in REQUIRED_MCP_DOMAINS. Every workflow must wire uses: ./.github/actions/news-prewarm in its frontmatter steps:.
  • In-Prompt MCP Gateway Diagnostics — keep the get_sync_status + safeoutputs___noop health-gate assertions on the effective prompt surface; replace the per-workflow inline pre-flight grep with the uses: reference check, and assert the Render MCP endpoint is probed inside the action.
  • Pre-warm and Keep-alive Patterns — pre-warm literal lookup moves from news-propositions.md to the action; per-workflow check accepts the uses: wiring as a valid pre-warm signal.
  • Step Ordering Awareness — frontmatter assertion is now "wires the shared action" rather than "contains the inline literal".
// before
expect(fm).toContain('Pre-flight external endpoint reachability check');

// after
expect(fm).toContain(`uses: ${NEWS_PREWARM_USES_REF}`);
// ...and the literal is asserted once, against the action file:
const action = fs.readFileSync(NEWS_PREWARM_ACTION, 'utf-8');
expect(action).toContain('Pre-flight external endpoint reachability check');

@pethers pethers marked this pull request as ready for review April 26, 2026 09:38
Copilot AI review requested due to automatic review settings April 26, 2026 09:38
@github-actions github-actions Bot added testing Test coverage size-m Medium change (50-250 lines) labels Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: testing,size-m

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the network-diagnostics test suite to reflect the post-#2008 architecture where pre-warm + pre-flight diagnostics moved from inline workflow YAML into the shared composite action .github/actions/news-prewarm/action.yml.

Changes:

  • Add constants to reference the shared news-prewarm composite action path and the uses: wiring string.
  • Move diagnostics literal assertions (step names, DNS/HTTPS/tool-count checks, required domain probes) from per-workflow greps to a single assertion against the composite action file.
  • Update workflow assertions to verify frontmatter steps: wires uses: ./.github/actions/news-prewarm, while keeping effective-prompt health-gate checks (get_sync_status, safeoutputs___noop) intact.

@pethers pethers merged commit ab054ca into main Apr 26, 2026
18 checks passed
@pethers pethers deleted the copilot/fix-unit-test-failures branch April 26, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-m Medium change (50-250 lines) testing Test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants