Skip to content

Clarify test WorkItem requirements in agent instructions#84017

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/update-agent-instructions
Draft

Clarify test WorkItem requirements in agent instructions#84017
Copilot wants to merge 1 commit into
mainfrom
copilot/update-agent-instructions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

This updates the repo’s agent guidance so test-related instructions consistently require WorkItem to appear directly alongside the test attribute, using the GitHub issue URL form. The goal is to make the expected test annotation pattern explicit and uniform across authoring and review guidance.

  • Scope

    • Updated the shared Copilot instructions and the compiler, IDE, and Razor instruction files.
    • Updated skill guidance used for analyzer/code-fix work and code review.
  • Behavioral guidance

    • Replaced looser phrasing like “add WorkItem for issue-based tests” with a single explicit rule:
      • always pair the test attribute with WorkItem
      • use the GitHub issue URL form
      • replace the sample issue number with the actual issue being addressed
  • Canonical example

    [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/1234")]
  • Why this matters

    • Removes ambiguity about placement and format.
    • Keeps test authoring guidance aligned across instruction sources and review surfaces.
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
- **Unit tests**: Test individual compiler phases (lexing, parsing)
- **Compilation tests**: Create `Compilation` objects and verify symbols/diagnostics
- **Cross-language patterns**: Many test patterns work for both C# and VB with minor syntax changes
- **Work items**: Always add `WorkItem` alongside test attributes, for example `[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/1234")]`, replacing `1234` with the GitHub issue number
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this in each area's instruction if it is already in the base instructions?

@akhera99
Copy link
Copy Markdown
Member

akhera99 commented Jun 4, 2026

Out of curiosity, where is this not working currently? The base instruction seems to get picked up by the CLI -- I've never had to prompt to add the workitem attributes there. Is this not working on VS/VSCode/GitHub?

## Testing

- Place `[WorkItem("url")]` on tests that track a specific issue (GitHub or DevOps URL).
- Always add `WorkItem` alongside test attributes, for example `[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/1234")]`, replacing `1234` with the GitHub issue number.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "always" wording here is interesting. Does it now add workitem attributes even if tests don't come from an obvious bug or issue?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants