Skip to content

test(code-metrics): isolate dispatch.test.sh from the developer's home configuration #16365

Closed

Description

@kyle-sexton

No related issue: found while checking an owed follow-up against the code.

Defect

30 of the 52 bash "$SCRIPT" invocations in plugins/code-metrics/scripts/dispatch.test.sh set no CODE_METRICS_HOME, case 1 at line 71 among them. plugins/code-metrics/scripts/entry-common.sh:99 then passes --home "${CODE_METRICS_HOME:-${HOME:-/}}", and resolve-config.py reads the user-global layer at <home>/.claude/<stem>.yaml, which covers ~/.claude/code-metrics.yaml and ~/.claude/ecosystems/<lane>.yaml. A developer whose home holds either file gets different lanes, thresholds or scope than CI, and assertions such as case 1's lane count can fail or pass for the wrong reason.

Done when

  • Every dispatch invocation in dispatch.test.sh sets CODE_METRICS_HOME to a test-owned directory, except one that tests the default on purpose and says so.
  • The suite passes unchanged with a ~/.claude/ecosystems/<bundled lane>.yaml present whose globs would change lane detection.

session: GitHub Support

Activity

  1. added
    needs-triage
    on Nov 15, 2026
  2. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    I understood this as a test-isolation defect. About 30 of the 52 invocations in plugins/code-metrics/scripts/dispatch.test.sh set no CODE_METRICS_HOME. Those runs read the developer's ~/.claude/code-metrics.yaml and ~/.claude/ecosystems/<lane>.yaml, so results can differ from CI. The fix is to point every invocation at a test-owned directory, apart from one that deliberately tests the default and says so. The suite should then pass with a home-level lane file present.

    Nothing is missing, and I found no duplicate among the open issues or a merged PR that already fixes it.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Nov 15, 2026
  4. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"4885ebe28f87851551b431993f2cb3a1fb58b9e2157ef54de2c75275dff54b65","body_sha256":"88d921208b9020be1d74bd6266c023d2a10bc49168ad2a5a4ab7edb5c6f287bd"}

  5. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor
    No description provided.
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

    Fields

    Work status

    needs-triage

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions