Skip to content

Bug: coverage-assembly-discovery-excludes-own-worktree-root #752

Description

@drmoisan
  • Work Mode: full-bug

Summary

scripts/vscode/Invoke-MSTestWithCoverage.ps1 excludes test assemblies whose absolute FullName matches \.claude\. When the script is run from a checkout that is itself located under .claude/worktrees/, every discovered assembly matches the exclusion, the discovered set is empty, and the script throws a misleading "No test assemblies found ... Build first." error.

Environment

  • OS/version: Windows 11 Pro 10.0.26200, PowerShell 7.
  • Python version: n/a (PowerShell).
  • Command/flags used: pwsh -File scripts/vscode/Invoke-MSTestWithCoverage.ps1 (default -Configuration Debug) run with the repo root at C:\Users\<user>\repos\TaskMaster\.claude\worktrees\agent-<id>\.
  • Data source or fixture: any built *.Test.dll under <worktree>\<Project>\bin\Debug\.

Steps to Reproduce

  1. Create an agent worktree under .claude/worktrees/ (the location used by every parallel-run and epic-run child) and build the solution there so *.Test.dll assemblies exist under bin\Debug\.
  2. From that worktree, run pwsh -File scripts/vscode/Invoke-MSTestWithCoverage.ps1.
  3. Observe the script throw No test assemblies found under '<worktree>' for configuration 'Debug'. Build first. even though the assemblies exist.

Expected Behavior

Assembly discovery excludes only sibling agent worktrees nested beneath the search root (the intent of the filter added by #733), and finds the test assemblies of the checkout the script is running from, regardless of where that checkout lives on disk.

Actual Behavior

The Where-Object predicate at scripts/vscode/Invoke-MSTestWithCoverage.ps1:301 on main ($_.FullName -notmatch '\\\.claude\\') tests the absolute path. When the search root is itself under .claude\worktrees\, every candidate path contains the segment and is excluded, so $testAssemblies is empty and the script throws with a message that misattributes the cause to a missing build.

Logs / Screenshots

  • Attached minimal logs or screenshot
  • Snippet: No test assemblies found under 'C:\Users\...\repos\TaskMaster\.claude\worktrees\agent-...' for configuration 'Debug'. Build first. (reported by the item Bug: ribbon-engine-toggle-defects #735 child orchestration during parallel run bugs-2026-09-02; recorded in artifacts/orchestration/parallel-orchestrator-state.json under environment_regression_from_item_733).

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

High for agent-driven development: every in-place coverage run from an agent worktree fails, which affects every C# item executed by the parallel and epic orchestration surfaces. CI is unaffected because the runner checkout path contains no .claude segment.

Source

From: docs/features/potential/2026-09-03-coverage-assembly-discovery-excludes-own-worktree-root.md

Activity

  1. drmoisan commented on Sep 6, 2026

    @drmoisan
    OwnerAuthor

    Delivered by #776 (merged 2026-09-04, merge commit c12c4c3).

    Verification on main (2026-09-06):

    • All 6 acceptance criteria in docs/features/active/2026-09-03-coverage-assembly-discovery-excludes-own-worktree-root-752/spec.md are checked.
    • Final feature audit (feature-audit.2026-09-04T00-30.md): PASS, no blocking findings remain.
    • scripts/vscode/Invoke-MSTestWithCoverage.ps1:301 now matches the .claude exclusion against the path relative to the search root ([System.IO.Path]::GetRelativePath($resolvedSearchRoot, $_.FullName) -notmatch '(^|\)\.claude\'), so a checkout under .claude/worktrees/ no longer excludes its own assemblies.

    Closing as completed.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions