Skip to content

Add ConditionalAssemblyAttribute#16820

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/add-conditionalassemblyattribute-tests
Open

Add ConditionalAssemblyAttribute#16820
Copilot wants to merge 5 commits into
mainfrom
copilot/add-conditionalassemblyattribute-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

Adds ConditionalAssemblyAttribute into the V3-only project, and adds a dedicated test project that exercises the attribute end-to-end via the runner.

Changes

  • Add to V3 sources: src/Microsoft.DotNet.XUnitV3Extensions/src/ConditionalAssemblyAttribute.cs.
  • New end-to-end test project Microsoft.DotNet.XUnitV3Extensions.AlwaysFalseConditionalAssembly.Tests: a single Assert.Fail test plus an assembly-level [ConditionalAssembly(typeof(Conditions), nameof(Conditions.AlwaysFalse))]. The runner is configured with --filter-not-trait "category=failing" --ignore-exit-code 8 so the project passes only when the attribute correctly stamps every test with the category=failing trait; if the attribute regresses, the failing test runs and breaks the build.
  • Project layout: Lives in the existing tests/ folder beside the existing tests csproj (no new folder). Compile globbing is scoped (EnableDefaultCompileItems=false + explicit <Compile Include> on the new project, <Compile Remove> on the sibling) so the assembly attribute and failing test do not bleed across projects.
  • Registered in Arcade.slnx.
  • Helix wiring: Registered in tests/UnitTests.proj as an XUnitV3Project (with the trait filter / ignore-exit-code passed via the Arguments metadata that CreateXUnitV3WorkItems appends to the Helix command line) and excluded from the XUnitProject glob, so PR validation runs it via the V3 self-hosting path with the same filter applied locally.

To double check:

Copilot AI and others added 2 commits May 14, 2026 22:18
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/f511792c-b425-4a96-ae81-93e3e1e733ed

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…roject

Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/c7a5c7aa-5ae1-4d02-a32a-068fb71c1535

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Moves ConditionalAssemblyAttribute into the xUnit v3 extensions project and adds tests intended to validate its behavior, including an end-to-end project with an always-false assembly condition.

Changes:

  • Adds V3-only ConditionalAssemblyAttribute.
  • Adds direct unit coverage for assembly-level condition behavior.
  • Adds a new always-failing test project meant to validate trait filtering end-to-end.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Microsoft.DotNet.XUnitV3Extensions/src/ConditionalAssemblyAttribute.cs Adds the V3 assembly-level conditional trait attribute.
src/Microsoft.DotNet.XUnitV3Extensions/tests/ConditionalAttributeTests.cs Adds unit tests for multiple/no/missing condition members and constructor storage.
src/Microsoft.DotNet.XUnitV3Extensions/tests/AlwaysFalseConditionalAssemblyTests.cs Adds the intentionally failing test guarded by an always-false assembly condition.
src/Microsoft.DotNet.XUnitV3Extensions/tests/Microsoft.DotNet.XUnitV3Extensions.AlwaysFalseConditionalAssembly.Tests.csproj Defines the new focused V3 test project and runner arguments.
src/Microsoft.DotNet.XUnitV3Extensions/tests/Microsoft.DotNet.XUnitV3Extensions.Tests.csproj Excludes the new test file from the sibling test project.
Arcade.slnx Adds the new test project to the solution.

Comment thread Arcade.slnx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI requested a review from AndriySvyryd May 15, 2026 00:37
@AndriySvyryd AndriySvyryd marked this pull request as ready for review May 15, 2026 00:37
@AndriySvyryd AndriySvyryd changed the title Move ConditionalAssemblyAttribute to V3 project and add end-to-end test Add ConditionalAssemblyAttribute May 15, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 17:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

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.

3 participants