-
Notifications
You must be signed in to change notification settings - Fork 826
.NET: Migrate to xunit.v3 #2259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Youssef1313
wants to merge
13
commits into
microsoft:main
Choose a base branch
from
Youssef1313:xunitv3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2f12e4d
Migrate to xunit.v3
Youssef1313 f26ecb7
Use net10 image
Youssef1313 d76e887
Adjust
Youssef1313 c644a02
coverage.config
Youssef1313 5ff6091
Fix
Youssef1313 7ea499d
no progress
Youssef1313 5c34fbd
coverage
Youssef1313 7088bd6
cobertura
Youssef1313 d49da2e
Fix coverage
Youssef1313 10fce0d
Fix coverage
Youssef1313 1753023
Fix coverage.config
Youssef1313 2bda7d5
Increase coverage
Youssef1313 fde747c
Merge branch 'main' into xunitv3
Youssef1313 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ jobs: | |
| - name: Setup dotnet | ||
| uses: actions/[email protected] | ||
| with: | ||
| global-json-file: ${{ github.workspace }}/dotnet/global.json | ||
| global-json-file: ${{ github.workspace }}/global.json | ||
| - name: Build dotnet solutions | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -145,9 +145,9 @@ jobs: | |
| # Check if the project supports the target framework | ||
| if [[ "$target_frameworks" == *"${{ matrix.targetFramework }}"* ]]; then | ||
| if [[ "${{ matrix.targetFramework }}" == "${{ env.COVERAGE_FRAMEWORK }}" ]]; then | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx --collect:"XPlat Code Coverage" --results-directory:"TestResults/Coverage/" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByAttribute=GeneratedCodeAttribute,CompilerGeneratedAttribute,ExcludeFromCodeCoverageAttribute | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} --project $project --no-progress --no-build -v Normal --report-trx --results-directory "TestResults/Coverage/" --coverage --coverage-output-format cobertura --coverage-settings "${{ github.workspace }}/dotnet/coverage.config" | ||
| else | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} --project $project --no-progress --no-build -v Normal --report-trx | ||
| fi | ||
| else | ||
| echo "Skipping $project - does not support target framework ${{ matrix.targetFramework }} (supports: $target_frameworks)" | ||
|
|
@@ -189,7 +189,7 @@ jobs: | |
|
|
||
| # Check if the project supports the target framework | ||
| if [[ "$target_frameworks" == *"${{ matrix.targetFramework }}"* ]]; then | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} --project $project --no-progress --no-build -v Normal --report-trx | ||
| else | ||
| echo "Skipping $project - does not support target framework ${{ matrix.targetFramework }} (supports: $target_frameworks)" | ||
| fi | ||
|
|
@@ -219,7 +219,7 @@ jobs: | |
| if: matrix.targetFramework == env.COVERAGE_FRAMEWORK | ||
| uses: danielpalme/[email protected] | ||
| with: | ||
| reports: "./TestResults/Coverage/**/coverage.cobertura.xml" | ||
| reports: "./TestResults/Coverage/**/*.cobertura.xml" | ||
| targetdir: "./TestResults/Reports" | ||
| reporttypes: "HtmlInline;JsonSummary" | ||
|
|
||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Configuration> | ||
| <CodeCoverage> | ||
| <!-- Match attributes on any code element: --> | ||
| <Attributes> | ||
| <Exclude> | ||
| <!-- Don't forget "Attribute" at the end of the name --> | ||
| <Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute> | ||
| <Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute> | ||
| <Attribute>^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$</Attribute> | ||
| </Exclude> | ||
| </Attributes> | ||
| </CodeCoverage> | ||
| </Configuration> |
2 changes: 1 addition & 1 deletion
2
dotnet/tests/AgentConformance.IntegrationTests/AgentConformance.IntegrationTests.csproj
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,24 +4,25 @@ | |
|
|
||
| <PropertyGroup> | ||
| <IsPackable>false</IsPackable> | ||
| <IsTestProject>true</IsTestProject> | ||
| <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: Update https://github.com/microsoft/agent-framework/blob/main/.github/copilot-instructions.md with instructions for MTP. dotnet/aspire already has some instructions for MTP that we can replicate. |
||
| <IsAotCompatible>false</IsAotCompatible> | ||
| <TargetFrameworks>net10.0;net472</TargetFrameworks> | ||
| <UserSecretsId>b7762d10-e29b-4bb1-8b74-b6d69a667dd4</UserSecretsId> | ||
| <NoWarn>$(NoWarn);Moq1410;xUnit2023</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="coverlet.collector" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
| <PackageReference Include="Moq" /> | ||
| <PackageReference Include="xRetry" /> | ||
| <PackageReference Include="xunit" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" /> | ||
| <PackageReference Include="xRetry.v3" /> | ||
| <PackageReference Include="xunit.v3.mtp-v2" Condition="'$(IsTestUtilityProject)'!='true'" /> | ||
| <PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Condition="'$(IsTestUtilityProject)'!='true'" /> | ||
| <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Condition="'$(IsTestUtilityProject)'!='true'" /> | ||
| <PackageReference Include="xunit.v3.extensibility.core" Condition="'$(IsTestUtilityProject)'=='true'" /> | ||
| <PackageReference Include="xunit.v3.assert" Condition="'$(IsTestUtilityProject)'=='true'" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Using Include="xRetry" /> | ||
| <Using Include="xRetry.v3" /> | ||
| <Using Include="Xunit" /> | ||
| </ItemGroup> | ||
|
|
||
|
|
||
4 changes: 4 additions & 0 deletions
4
dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/Microsoft.Agents.AI.A2A.UnitTests.csproj
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
4 changes: 4 additions & 0 deletions
4
dotnet/tests/Microsoft.Agents.AI.AGUI.UnitTests/Microsoft.Agents.AI.AGUI.UnitTests.csproj
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
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
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
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
4 changes: 4 additions & 0 deletions
4
...s.AI.AzureAI.Persistent.UnitTests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests.csproj
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
4 changes: 4 additions & 0 deletions
4
.../tests/Microsoft.Agents.AI.AzureAI.UnitTests/Microsoft.Agents.AI.AzureAI.UnitTests.csproj
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.