Skip to content

Bug: mstest-coverage-discovery-claude-worktree-exclusion #531

Description

@drmoisan
  • Work Mode: minor-audit

Summary

Invoke-MSTestWithCoverage.ps1 test-assembly discovery lacks a \.claude\ exclusion, so running with -SearchRoot . descends into agent worktrees and picks up stale sibling-worktree assemblies.

Environment

  • OS/version: Windows 11 Pro 10.0.26200
  • Python version: n/a (PowerShell)
  • Command/flags used: scripts/vscode/Invoke-MSTestWithCoverage.ps1 -SearchRoot .
  • Data source or fixture: main checkout C:\Users\DanMoisan\repos\TaskMaster containing .claude\worktrees\agent-*\

Steps to Reproduce

  1. Create at least one agent worktree under .claude\worktrees\agent-*\ and build it so it contains *.Test.dll assemblies.
  2. From the main checkout, run scripts/vscode/Invoke-MSTestWithCoverage.ps1 -SearchRoot ..
  3. Inspect the discovered assembly list and the resulting coverage figure.

Expected Behavior

Discovery should enumerate only the current checkout's test assemblies and ignore any path under .claude\worktrees\.

Actual Behavior

scripts/vscode/Invoke-MSTestWithCoverage.ps1:296-302 filters discovered *.Test.dll paths on \bin\<Configuration>\, \obj\ and \ref\ only. There is no \.claude\ guard, so discovery descends into .claude\worktrees\agent-*\** and picks up stale sibling-worktree assemblies, producing bogus AssemblyInitialize signature failures and a coverage figure computed over the wrong assembly set.

Logs / Screenshots

  • Attached minimal logs or snippet
  • Snippet: bogus AssemblyInitialize signature failures originating from assemblies under .claude\worktrees\agent-*\.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Local coverage runs report a figure computed over the wrong assembly set, and spurious failures obscure real ones.

Source

From: docs/features/potential/2026-08-10-mstest-coverage-discovery-claude-worktree-exclusion.md

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