Add ConditionalAssemblyAttribute#16820
Open
Copilot wants to merge 5 commits into
Open
Conversation
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>
Copilot created this pull request from a session on behalf of
AndriySvyryd
May 15, 2026 00:16
View session
Contributor
There was a problem hiding this comment.
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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/9ce52956-f717-4d70-baf9-0b5075b09a32 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Open
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ConditionalAssemblyAttributeinto the V3-only project, and adds a dedicated test project that exercises the attribute end-to-end via the runner.Changes
src/Microsoft.DotNet.XUnitV3Extensions/src/ConditionalAssemblyAttribute.cs.Microsoft.DotNet.XUnitV3Extensions.AlwaysFalseConditionalAssembly.Tests: a singleAssert.Failtest plus an assembly-level[ConditionalAssembly(typeof(Conditions), nameof(Conditions.AlwaysFalse))]. The runner is configured with--filter-not-trait "category=failing" --ignore-exit-code 8so the project passes only when the attribute correctly stamps every test with thecategory=failingtrait; if the attribute regresses, the failing test runs and breaks the build.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.Arcade.slnx.tests/UnitTests.projas anXUnitV3Project(with the trait filter / ignore-exit-code passed via theArgumentsmetadata thatCreateXUnitV3WorkItemsappends to the Helix command line) and excluded from theXUnitProjectglob, so PR validation runs it via the V3 self-hosting path with the same filter applied locally.To double check: