Skip to content

fix: 29 pre-existing test suite failures remaining after #3340/#3341 #3344

Description

@eleshar

Problem

npm run test on main still fails after PR #3341 (the moduleNameMapper regex fix for #3340). That PR reduced failures from 51 to 29 failed suites, but 29 remain:

agents/metadata-agent/__tests__/api/octokit-client.test.js
agents/metadata-agent/__tests__/api/retry-strategy.test.js
agents/pr-creation-agent/__tests__/integration/label-application-scenarios.test.js
agents/pr-creation-agent/__tests__/orchestrate-pr-creation.test.js
agents/pr-creation-agent/__tests__/route-pr-template.test.js
agents/pr-creation-agent/__tests__/validate-branch-name.test.js
scripts/agents/__tests__/issues.agent.test.js
scripts/agents/__tests__/linting-agent/integration/block-plugin.integration.test.js
scripts/agents/__tests__/linting-agent/integration/control-plane.integration.test.js
scripts/agents/__tests__/linting-agent/integration/wordpress-plugin.integration.test.js
scripts/agents/__tests__/linting-agent/integration/wordpress-theme.integration.test.js
scripts/agents/__tests__/module-system-consistency.test.js
scripts/agents/__tests__/planner.agent.test.js
scripts/agents/__tests__/release.agent.mcp.test.js
scripts/agents/includes/__tests__/changelogUtils.test.js
scripts/agents/includes/__tests__/check-template-labels.test.js
scripts/agents/includes/__tests__/header-footer.test.js
scripts/agents/includes/__tests__/label-heuristics.test.js
scripts/agents/includes/__tests__/label-sync.test.js
scripts/automation/__tests__/integration-workflow-staging.test.js
scripts/automation/issue-agent/shared/__tests__/github-client.test.js
scripts/metrics/__tests__/integration.test.js
scripts/metrics/__tests__/metrics-reporter.test.js
scripts/metrics/__tests__/metrics-storage.test.js
scripts/metrics/__tests__/performance.test.js
scripts/metrics/integrations/__tests__/issue-templates.test.js
scripts/validation/__tests__/openspec-labels.test.js
scripts/validation/__tests__/project-meta-sync.test.js
scripts/workflows/branch-policy/__tests__/validate-main-branch-pr.test.js

213 individual tests fail across these 29 suites (of 3725 total). This is a Test Suites: 29 failed, 177 passed, 206 total / Tests: 213 failed, 10 todo, 3502 passed, 3725 total result.

Impact

The check CI job (npm run test) fails on every recent PR regardless of content — confirmed also failing on the just-merged PR #3337. It does not appear to actually gate merging (Mergify shows Merge Protections: skipping on affected PRs), but it means the "check" status is permanently red and not a meaningful signal.

One confirmed root cause among these

scripts/agents/issues.agent.cjs:13const __filename = __filename || process.argv[1]; throws SyntaxError: Identifier '__filename' has already been declared under Jest's CommonJS transform, since __filename is already a module-scope binding there. This breaks scripts/agents/__tests__/issues.agent.test.js (and likely planner.agent.test.js, which follows the same ../X.agent.cjs require pattern per its own failure in the same run — worth checking planner.agent.cjs for the identical const __filename = __filename || ... idiom).

Suggested approach

  1. Triage the 29 suites into root-cause clusters (the __filename redeclaration pattern likely explains several of the *.agent.test.js failures at once).
  2. Fix cluster by cluster rather than file by file.
  3. Once npm run test is clean, consider whether check should become an actual required/blocking status check — right now a permanently-red required-looking check that doesn't block merges is worse than no check.

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions