Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e427f13
Migrate from VSTest to Microsoft.Testing.Platform
Youssef1313 Apr 2, 2025
d09bcd5
Address TODO
Youssef1313 Apr 2, 2025
58a546a
Cleanup stuff around runsettings
Youssef1313 Apr 3, 2025
3e4ccd1
Add comment
Youssef1313 Apr 3, 2025
f1a32f2
Progress
Youssef1313 Apr 3, 2025
8bd7802
Remove locale
Youssef1313 Apr 3, 2025
c179724
Always show live output
Youssef1313 Apr 3, 2025
d82894a
Restore test session timeout
Youssef1313 Apr 3, 2025
04dfe12
Fix timeout
Youssef1313 Apr 3, 2025
6cd862b
Fix typo
Youssef1313 Apr 3, 2025
3b40316
Fix duplicate commnand-line options
Youssef1313 Apr 3, 2025
f7e6994
Fix Linux
Youssef1313 Apr 3, 2025
45fd316
Fix for Linux
Youssef1313 Apr 3, 2025
e5458d1
Fix
Youssef1313 Apr 3, 2025
519188d
Fix
Youssef1313 Apr 3, 2025
cb6cd28
Filter failing
Youssef1313 Apr 4, 2025
29087a6
Fix
Youssef1313 Apr 4, 2025
5f0f004
ignore exit code 8
Youssef1313 Apr 4, 2025
ce7e735
Fix extra dot
Youssef1313 Apr 4, 2025
e0b800c
Ignore exit code
Youssef1313 Apr 4, 2025
c44896a
Fix duplicate --ignore-exit-code
Youssef1313 Apr 4, 2025
f15a1c1
Fix playground tests on helix
radical Apr 4, 2025
d3795eb
Move to RepoTesting.props
Youssef1313 Apr 5, 2025
e440ddf
Fix results dir
Youssef1313 Apr 5, 2025
f33dc66
Fix
Youssef1313 Apr 5, 2025
688b6d6
Progress
Youssef1313 Apr 5, 2025
a8b0cd6
Fix duplicate command-line option
Youssef1313 Apr 5, 2025
cc26956
Missing report-trx
Youssef1313 Apr 7, 2025
11e89e4
Merge branch 'main' into dev/ygerges/migrate-to-mtp
danmoseley Apr 7, 2025
5ea5eac
Merge branch 'main' into dev/ygerges/migrate-to-mtp
Youssef1313 Apr 8, 2025
d10e168
Run executable
Youssef1313 Apr 9, 2025
c54564b
Address review comments
Youssef1313 Apr 9, 2025
8f77898
Revert "Run executable"
Youssef1313 Apr 9, 2025
4ba7d9a
dotnet dll
Youssef1313 Apr 9, 2025
5201f07
Introduce version selector for Aspire templates (#8625)
mitchdenny Apr 8, 2025
7817820
Error handling for GetCapabilitiesAsync connection issues (#8614)
mitchdenny Apr 8, 2025
4a3a753
Obsolete AddAzureContainerAppsInfrastructure (#8639)
eerhardt Apr 8, 2025
42735e0
Add error handling for package updates in workflow (#8390)
joperezr Apr 8, 2025
d414db6
Filter out tracing health endpoints in service defaults templates (#8…
DamianEdwards Apr 8, 2025
5f89e7d
Show neutral icon for container exiting with status code 0 (#8477)
adamint Apr 8, 2025
ec6cacb
[tests] Correctly mark Aspire.Dashboard.Tests.Integration.Playwright.…
radical Apr 8, 2025
5958a02
[tests] Skip generating Directory.Packages.Versions.props for Test (#…
radical Apr 8, 2025
ddf0755
Fix running playground tests on windows
radical Apr 9, 2025
8e5e3db
Merge branch 'main' into dev/ygerges/migrate-to-mtp
Youssef1313 Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:
# relative the repo root
required: false
type: string
testSessionTimeoutMs:
testSessionTimeout:
required: false
type: string
default: "900000"
default: "15m"
testHangTimeout:
required: false
type: string
Expand Down Expand Up @@ -220,18 +220,14 @@ jobs:
TEST_LOG_PATH: ${{ github.workspace }}/artifacts/log/test-logs
TestsRunningOutsideOfRepo: true
run: >
dotnet test -s .runsettings -v:n ${{ env.TEST_ASSEMBLY_NAME }}.dll
-l "console;verbosity=normal"
-l "trx;LogFilePrefix=${{ inputs.testShortName }}"
-l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
--blame
--blame-hang-timeout ${{ inputs.testHangTimeout }}
--blame-crash
dotnet ${{ env.TEST_ASSEMBLY_NAME }}.dll
--report-trx --report-trx-filename "${{ inputs.testShortName }}.trx"
--hangdump --hangdump-timeout ${{ inputs.testHangTimeout }}
--crashdump
--results-directory ${{ github.workspace }}/testresults
--filter-not-trait "category=failing"
--timeout ${{ inputs.testSessionTimeout }}
${{ inputs.extraTestArgs }}
--
RunConfiguration.CollectSourceInformation=true
RunConfiguration.TestSessionTimeout=${{ inputs.testSessionTimeoutMs }}

- name: Run tests
if: ${{ ! inputs.requiresNugets }}
Expand All @@ -240,24 +236,24 @@ jobs:
CI: false
DCP_DIAGNOSTICS_LOG_LEVEL: debug
DCP_DIAGNOSTICS_LOG_FOLDER: ${{ github.workspace }}/testresults/dcp
# During restore and build, we use -ci, which causes NUGET_PACKAGES to point to a local cache (Arcade behavior).
# In this step, we are not using Arcade, but want to make sure that MSBuild is able to evaluate correctly.
# So, we manually set NUGET_PACKAGES
NUGET_PACKAGES: ${{ github.workspace }}/.packages
run: >
${{ env.DOTNET_SCRIPT }} test ${{ env.TEST_PROJECT_PATH }}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this one still dotnet test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not intending to do any broader refactorings with this PR. This was dotnet test, so I'm keeping as is. We can have a separate build step and then run the executable, but I'm trying to not change much as part of this PR.

/p:ContinuousIntegrationBuild=true
-s eng/testing/.runsettings
-l "console;verbosity=normal"
-l "trx;LogFilePrefix=${{ inputs.testShortName }}"
-l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
"--blame"
--blame-hang-timeout ${{ inputs.testHangTimeout }}
--blame-crash
--results-directory testresults
/p:TrxFileNamePrefix="${{ inputs.testShortName }}"
-bl:${{ github.workspace }}/testresults/test.binlog
--no-restore
--no-build
-bl:${{ github.workspace }}/testresults/test.binlog
${{ inputs.extraTestArgs }}
--
RunConfiguration.CollectSourceInformation=true
RunConfiguration.TestSessionTimeout=${{ inputs.testSessionTimeoutMs }}
--report-trx
--hangdump --hangdump-timeout ${{ inputs.testHangTimeout }}
--crashdump
--results-directory ${{ github.workspace }}/testresults
--timeout ${{ inputs.testSessionTimeout }}
${{ inputs.extraTestArgs }}

# Save the result of the previous steps - success or failure
# in the form of a file result-success/result-failure -{name}.rst
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
with:
testShortName: ${{ matrix.shortname }}
os: "ubuntu-latest"
extraTestArgs: "--filter \"(quarantined!=true)\""
extraTestArgs: "--filter-not-trait \"quarantined=true\""

integrations_test_win:
uses: ./.github/workflows/run-tests.yml
Expand All @@ -90,7 +90,7 @@ jobs:
with:
testShortName: ${{ matrix.shortname }}
os: "windows-latest"
extraTestArgs: "--filter \"(quarantined!=true)\""
extraTestArgs: "--filter-not-trait \"quarantined=true\""

templates_test_lin:
name: Templates Linux
Expand All @@ -103,10 +103,9 @@ jobs:
testShortName: ${{ matrix.shortname }}
os: "ubuntu-latest"
testProjectPath: tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj
testSessionTimeoutMs: 1200000
testSessionTimeout: 20m
testHangTimeout: 12m
# append '.' to the name so only the test class with exactly that name is run
extraTestArgs: "--filter \"(quarantined!=true)&(FullyQualifiedName~Aspire.Templates.Tests.${{ matrix.shortname }}.)\""
extraTestArgs: "--filter-not-trait quarantined=true --filter-class Aspire.Templates.Tests.${{ matrix.shortname }}"
requiresNugets: true
requiresTestSdk: true

Expand All @@ -121,10 +120,9 @@ jobs:
testShortName: ${{ matrix.shortname }}
os: "windows-latest"
testProjectPath: tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj
testSessionTimeoutMs: 1200000
testSessionTimeout: 20m
testHangTimeout: 12m
# append '.' to the name so only the test class with exactly that name is run
extraTestArgs: "--filter \"(quarantined!=true)&(FullyQualifiedName~Aspire.Templates.Tests.${{ matrix.shortname }}.)\""
extraTestArgs: "--filter-not-trait quarantined=true --filter-class Aspire.Templates.Tests.${{ matrix.shortname }}"
requiresNugets: true
requiresTestSdk: true

Expand Down
33 changes: 0 additions & 33 deletions eng/.runsettings

This file was deleted.

19 changes: 7 additions & 12 deletions eng/Testing.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@
<RunOnAzdoCILinux>true</RunOnAzdoCILinux>
<RunOnAzdoHelixWindows>true</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>true</RunOnAzdoHelixLinux>
</PropertyGroup>

<PropertyGroup Condition="'$(UseVSTestRunner)' != 'true'">
<_QuarantinedTestRunAdditionalArgs>-trait "quarantined=true"</_QuarantinedTestRunAdditionalArgs>
<_NonQuarantinedTestRunAdditionalArgs>-notrait "quarantined=true"</_NonQuarantinedTestRunAdditionalArgs>
</PropertyGroup>

<PropertyGroup Condition="'$(UseVSTestRunner)' == 'true'">
<_QuarantinedTestRunAdditionalArgs>--filter "quarantined=true"</_QuarantinedTestRunAdditionalArgs>
<_NonQuarantinedTestRunAdditionalArgs>--filter "quarantined!=true"</_NonQuarantinedTestRunAdditionalArgs>
<_QuarantinedTestRunAdditionalArgs>--filter-trait "quarantined=true"</_QuarantinedTestRunAdditionalArgs>
<_NonQuarantinedTestRunAdditionalArgs>--filter-not-trait "quarantined=true"</_NonQuarantinedTestRunAdditionalArgs>
</PropertyGroup>

<PropertyGroup>
<BlameHangTimeout Condition="'$(BlameHangTimeout)' == ''">10m</BlameHangTimeout>
<_BlameArgs>--blame --blame-hang-timeout $(BlameHangTimeout) --blame-crash</_BlameArgs>
<_BlameArgs>--hangdump --hangdump-timeout $(BlameHangTimeout) --crashdump</_BlameArgs>

<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --filter-not-trait &quot;category=failing&quot;</TestRunnerAdditionalArguments>

<TestRunnerAdditionalArguments Condition="'$(RunQuarantinedTests)' == ''">$(TestRunnerAdditionalArguments) $(_NonQuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) $(_BlameArgs)</TestRunnerAdditionalArguments>
<TestRunnerAdditionalArguments Condition="'$(RunQuarantinedTests)' == 'true'">$(TestRunnerAdditionalArguments) $(_QuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) $(_BlameArgs)</TestRunnerAdditionalArguments>
<TestRunnerAdditionalArguments Condition="'$(RunQuarantinedTests)' != 'true'">$(TestRunnerAdditionalArguments) $(_NonQuarantinedTestRunAdditionalArgs) $(_BlameArgs)</TestRunnerAdditionalArguments>
<TestRunnerAdditionalArguments Condition="'$(RunQuarantinedTests)' == 'true'">$(TestRunnerAdditionalArguments) $(_QuarantinedTestRunAdditionalArgs) $(_BlameArgs)</TestRunnerAdditionalArguments>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<DotNetRuntimePreviousVersionForTesting>8.0.13</DotNetRuntimePreviousVersionForTesting>
<!-- dotnet 8.0 versions for running tests - used for templates tests -->
<DotNetSdkPreviousVersionForTesting>8.0.406</DotNetSdkPreviousVersionForTesting>
<UseVSTestRunner>true</UseVSTestRunner>
<XunitV3Version>2.0.0</XunitV3Version>
<XUnitAnalyzersVersion>1.20.0</XUnitAnalyzersVersion>
<XunitRunnerVisualStudioVersion>3.0.2</XunitRunnerVisualStudioVersion>
<MicrosoftTestingPlatformVersion>1.6.3</MicrosoftTestingPlatformVersion>
<!-- Enable to remove prerelease label. -->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
Expand Down
92 changes: 92 additions & 0 deletions eng/Xunit3/Microsoft.Testing.Platform.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>

<Target Name="RunTests"
Outputs="%(TestToRun.ResultsStdOutPath)"
Condition="'@(TestToRun)' != ''">
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Test" />

<PropertyGroup>
<_TestResultDirectory>$([System.IO.Path]::GetDirectoryName('%(TestToRun.ResultsTrxPath)'))</_TestResultDirectory>
<_TestResultTrxFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsTrxPath)'))</_TestResultTrxFileName>
<_TestResultXmlFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsXmlPath)'))</_TestResultXmlFileName>
<_TestResultHtmlFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsHtmlPath)'))</_TestResultHtmlFileName>
</PropertyGroup>

<PropertyGroup>
<_TestEnvironment>%(TestToRun.EnvironmentDisplay)</_TestEnvironment>
<_TestAssembly>%(TestToRun.Identity)</_TestAssembly>
<_TestAssembly Condition="'$(OS)'=='Windows_NT'">$([System.IO.Path]::ChangeExtension($(_TestAssembly), '.exe'))</_TestAssembly>
<_TestAssembly Condition="'$(OS)'!='Windows_NT'">$(_TestAssembly.TrimEnd('.dll'))</_TestAssembly>
<_TestRuntime>%(TestToRun.TestRuntime)</_TestRuntime>
<_TestTimeout>%(TestToRun.TestTimeout)</_TestTimeout>
<_TestRunnerAdditionalArguments>%(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>

<_TestRunner>$(_TestAssembly)</_TestRunner>
<_TestRunnerArgs>$(_TestRunnerAdditionalArguments) --results-directory "$(_TestResultDirectory)" --report-xunit --report-xunit-filename "$(_TestResultXmlFileName)" --report-xunit-html --report-xunit-html-filename "$(_TestResultHtmlFileName)" --report-trx --report-trx-filename "$(_TestResultTrxFileName)"</_TestRunnerArgs>
</PropertyGroup>

<PropertyGroup Condition="'$(_TestRuntime)' == 'Core'">
<_TestRunnerArgs>$(_TestRunnerArgs) --auto-reporters off</_TestRunnerArgs>
</PropertyGroup>

<PropertyGroup>
<_TestRunnerCommand>"$(_TestRunner)" $(_TestRunnerArgs)</_TestRunnerCommand>

<!--
Redirect std output of the runner.
Note that xUnit outputs failure info to both STDOUT (stack trace, message) and STDERR (failed test name)
-->
<_TestRunnerCommand Condition="'$(TestCaptureOutput)' != 'false'">$(_TestRunnerCommand) > "%(TestToRun.ResultsStdOutPath)" 2>&amp;1</_TestRunnerCommand>
</PropertyGroup>

<ItemGroup>
<_OutputFiles Include="%(TestToRun.ResultsXmlPath)" />
<_OutputFiles Include="%(TestToRun.ResultsHtmlPath)" />
<_OutputFiles Include="%(TestToRun.ResultsStdOutPath)" />
</ItemGroup>

<MakeDir Directories="@(_OutputFiles->'%(RootDir)%(Directory)')"/>
<Delete Files="@(_OutputFiles)" />

<Message Text="Running tests: $(_TestAssembly) [$(_TestEnvironment)]" Importance="high"/>
<Exec Command='$(_TestRunnerCommand)'
LogStandardErrorAsError="false"
WorkingDirectory="$(_TargetDir)"
IgnoreExitCode="true"
Timeout="$(_TestTimeout)"
EnvironmentVariables="DOTNET_ROOT=$(DotNetRoot);DOTNET_ROOT_X86=$(DotNetRoot)x86"
ContinueOnError="WarnAndContinue">
<Output TaskParameter="ExitCode" PropertyName="_TestErrorCode" />
</Exec>

<!--
Add command line to the log.
-->
<WriteLinesToFile File="%(TestToRun.ResultsStdOutPath)"
Overwrite="false"
Lines=";=== COMMAND LINE ===;$(_TestRunnerCommand)"
Condition="'$(TestCaptureOutput)' != 'false'" />

<!--
Report test status.
-->
<Message Text="Tests succeeded: $(_TestAssembly) [$(_TestEnvironment)]" Condition="'$(_TestErrorCode)' == '0'" Importance="high" />

<PropertyGroup>
<_ResultsFileToDisplay>%(TestToRun.ResultsHtmlPath)</_ResultsFileToDisplay>
<_ResultsFileToDisplay Condition="!Exists('$(_ResultsFileToDisplay)')">%(TestToRun.ResultsStdOutPath)</_ResultsFileToDisplay>
</PropertyGroup>

<!--
Ideally we would set ContinueOnError="ErrorAndContinue" so that when a test fails in multi-targeted test project
we'll still run tests for all target frameworks. ErrorAndContinue doesn't work well on Linux though: https://github.com/Microsoft/msbuild/issues/3961.
-->
<Error Text="Tests failed: $(_ResultsFileToDisplay) [$(_TestEnvironment)]" Condition="'$(_TestErrorCode)' != '0' and '$(_ErrorOnTestFailure)' != 'false'" File="XUnit" />

<ItemGroup>
<FileWrites Include="@(_OutputFiles)"/>
</ItemGroup>
</Target>

</Project>
16 changes: 12 additions & 4 deletions eng/Xunit3/Xunit3.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
<PackageVersion Include="xunit.v3.core" Version="$(XunitV3Version)" />
<PackageVersion Include="xunit.analyzers" Version="$(XunitAnalyzersVersion)" />
<PackageVersion Include="xunit.v3.assert" Version="$(XunitV3Version)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioVersion)" />
<PackageVersion Include="xunit.v3.runner.console" Version="$(XunitV3Version)" />
<PackageVersion Include="Microsoft.Testing.Platform" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Platform.MSBuild" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.HangDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />

<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.v3.core" />
<PackageReference Include="xunit.analyzers" />
<PackageReference Include="xunit.v3.assert" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="Microsoft.Testing.Platform" />
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
</ItemGroup>

<Import Project="..\tools\VSTest.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>
<Import Project="Microsoft.Testing.Platform.targets" />
</Project>
35 changes: 0 additions & 35 deletions eng/testing/.runsettings

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<!-- https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-exit-codes -->
<!-- Exit code 8 is "zero tests ran" -->
<!-- Currently, none of the tests in this project run in CI. All are ignored -->
Copy link
Member

Choose a reason for hiding this comment

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

This is not a real test project. It needs <IsTestUtilityProject>true</IsTestUtilityProject> which got dropped in #8279 . Adding that back should mean the project would get skipped completely.

Copy link
Contributor

Choose a reason for hiding this comment

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

@radical, no, this IS a test project. It contains tests. For example:

[Theory]
[InlineData(true)]
[InlineData(false)]
public void HealthChecksRegistersHealthCheckService(bool enabled)

[Fact]
public async Task EachKeyedComponentRegistersItsOwnHealthCheck()

All non-test infra was moved to Aspire.TestUtils.

Copy link
Member

Choose a reason for hiding this comment

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

But these tests are never run by themselves. They are run through other test classes that extend this ConformanceTests class.

Copy link
Member

Choose a reason for hiding this comment

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

The changes here can be dropped, replaced by <IsTestUtilityProject>true</IsTestUtilityProject>.

Copy link
Contributor

Choose a reason for hiding this comment

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

But these tests are never run by themselves. They are run through other test classes that extend this ConformanceTests class.

In this case the project should be renamed to remove ".Tests" suffix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we do in a follow-up PR?

<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --ignore-exit-code 8</TestingPlatformCommandLineArguments>
Copy link
Contributor

Choose a reason for hiding this comment

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

@Youssef1313 this doesn't appear to be used in Microsoft.Testing.Platform.targets, which results in the tests to fail
image

Should this be tucked on to _TestRunnerArgs?

<_TestRunnerAdditionalArguments>%(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
<_TestRunner>$(_TestAssembly)</_TestRunner>
<_TestRunnerArgs>$(_TestRunnerAdditionalArguments) --results-directory "$(_TestResultDirectory)" --report-xunit --report-xunit-filename "$(_TestResultXmlFileName)" --report-xunit-html --report-xunit-html-filename "$(_TestResultHtmlFileName)" --report-trx --report-trx-filename "$(_TestResultTrxFileName)"</_TestRunnerArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(_TestRuntime)' == 'Core'">
<_TestRunnerArgs>$(_TestRunnerArgs) --auto-reporters off</_TestRunnerArgs>
</PropertyGroup>

Copy link
Member Author

Choose a reason for hiding this comment

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

@RussKie TestingPlatformCommandLineArguments is currently used when invoking dotnet test but not when invoked via Arcade.

Copy link
Contributor

Choose a reason for hiding this comment

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

What would be the right way to fix this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you can simply append TestingPlatformCommandLineArguments to _TestRunnerArgs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, what I'm suggesting won't probably be possible without my PR on Arcade side. For now I think you could duplicate the --ignore-exit-code 8 on both sides.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or simply just rename Aspire.Components.Common.Tests to end with TestUtilities if it's really not intended to be a test project, then you don't need the --ignore-exit-code 8 at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or simply just rename Aspire.Components.Common.Tests to end with TestUtilities if it's really not intended to be a test project, then you don't need the --ignore-exit-code 8 at all.

Yep, working on it

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we can do it easily (if at all).
The project uses XUnit API (like fact and theory), and we need to import the Xunit assemblies. Those are defined in eng/Xunit3/Xunit3.targets and can only be imported by test projects. If the targets imported explicitly, then the build gets failed by _XunitValidateBuild declared in xunit.v3.core.targets

D:\Development\dotnet-aspire\.packages\xunit.v3.core\2.0.0\buildTransitive\xunit.v3.core.targets(15,5): xUnit.net v3 test projects must be executable (set project property '<OutputType>Exe</OutputType>'). If this is not a test project, reference xunit.v3.extensibilty.core instead. [D:\Development\dotnet-aspire\tests\Aspire.Components.Common.Tests\Aspire.Components.Common.TestUtilities.csproj]

Copy link
Member Author

@Youssef1313 Youssef1313 Apr 10, 2025

Choose a reason for hiding this comment

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

@RussKie You need to reference only xunit.v3.extensibility.core in that project, and not xunit.v3.core, nor xunit.v3

</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 0 additions & 26 deletions tests/Aspire.EndToEnd.Tests/.runsettings

This file was deleted.

1 change: 0 additions & 1 deletion tests/Aspire.EndToEnd.Tests/Aspire.EndToEnd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<DefineConstants Condition="'$(_BuildForTestsRunningOutsideOfRepo)' == 'true'">BUILD_FOR_TESTS_RUNNING_OUTSIDE_OF_REPO;$(DefineConstants)</DefineConstants>

<XunitRunnerJson>xunit.runner.json</XunitRunnerJson>
<RunSettingsFilePath>$(MSBuildThisFileDirectory).runsettings</RunSettingsFilePath>
<TestArchiveTestsDir>$(TestArchiveTestsDirForEndToEndTests)</TestArchiveTestsDir>
</PropertyGroup>

Expand Down
Loading