Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion .github/workflows/specialized-test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
outputs:
runsheet: ${{ steps.generate_tests_matrix.outputs.runsheet }}
requiresNugets: ${{ steps.check_nugets.outputs.requiresNugets }}
requiresCliArchive: ${{ steps.check_cli_archive.outputs.requiresCliArchive }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down Expand Up @@ -83,6 +84,16 @@ jobs:
echo "requiresNugets=false" >> $GITHUB_OUTPUT
fi

- name: Check if any test requires CLI archives
id: check_cli_archive
run: |
RUNSHEET='${{ steps.generate_tests_matrix.outputs.runsheet }}'
if echo "$RUNSHEET" | jq -e 'any(.[]; .requiresCliArchive == true)' > /dev/null 2>&1; then
echo "requiresCliArchive=true" >> $GITHUB_OUTPUT
else
echo "requiresCliArchive=false" >> $GITHUB_OUTPUT
fi

- name: Upload logs, and test results
if: ${{ always() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
Expand All @@ -104,7 +115,7 @@ jobs:
build_cli_archives:
name: Build native CLI archives
needs: [generate_tests_matrix]
if: ${{ github.repository_owner == 'dotnet' && needs.generate_tests_matrix.outputs.requiresNugets == 'true' }}
if: ${{ github.repository_owner == 'dotnet' && (needs.generate_tests_matrix.outputs.requiresNugets == 'true' || needs.generate_tests_matrix.outputs.requiresCliArchive == 'true') }}
uses: ./.github/workflows/build-cli-native-archives.yml

run_tests:
Expand All @@ -124,6 +135,7 @@ jobs:
enablePlaywrightInstall: ${{ inputs.enablePlaywrightInstall }}
extraTestArgs: ${{ inputs.extraTestArgs }}
ignoreTestFailures: ${{ inputs.ignoreTestFailures }}
requiresCliArchive: ${{ matrix.tests.requiresCliArchive == true }}

results:
if: ${{ always() && github.repository_owner == 'dotnet' }}
Expand Down
36 changes: 20 additions & 16 deletions eng/SpecializedTestRunsheetBuilderBase.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
-->

<!--
Skip Templates, Playground, and EndToEnd tests for specialized test workflows as these are known to be broken.
See https://github.com/dotnet/aspire/issues/11747 for tracking the work to enable these tests.
Skip Playground tests for specialized test workflows.
These still need setup that is not wired through this runsheet builder.
-->
<PropertyGroup>
<_IsUnsupportedProject>false</_IsUnsupportedProject>
<_IsUnsupportedProject Condition="$(MSBuildProjectName.Contains('Templates')) or $(MSBuildProjectName.Contains('Playground')) or $(MSBuildProjectName.Contains('EndToEnd'))">true</_IsUnsupportedProject>
<_IsUnsupportedProject Condition="$(MSBuildProjectName.Contains('Playground'))">true</_IsUnsupportedProject>
</PropertyGroup>

<Target Name="RunTests"
Expand Down Expand Up @@ -121,19 +121,23 @@
<_RelativeTestProjectPath>$([System.String]::Copy('$(MSBuildProjectFullPath)').Replace('$(RepoRoot)', '%24(pwd)/'))</_RelativeTestProjectPath>
<_RelativeTestBinLog>$([System.String]::Copy('$(_TestBinLog)').Replace('$(RepoRoot)', '%24(pwd)/'))</_RelativeTestBinLog>

<!--
Determine if this test project requires nugets.
Templates, Playground, and EndToEnd tests require built nugets.
-->
<_RequiresNugets>false</_RequiresNugets>
<_RequiresNugets Condition="$(MSBuildProjectName.Contains('Templates')) or $(MSBuildProjectName.Contains('Playground')) or $(MSBuildProjectName.Contains('EndToEnd'))">true</_RequiresNugets>
<_RequiresNugets Condition="'$(RequiresNugets)' == 'true'">true</_RequiresNugets>

<!--
Determine if this test project requires test SDK.
Template tests require the test SDK.
-->
<_RequiresTestSdk>false</_RequiresTestSdk>
<_RequiresTestSdk Condition="$(MSBuildProjectName.Contains('Templates'))">true</_RequiresTestSdk>
<_RequiresTestSdk Condition="'$(RequiresTestSdk)' == 'true'">true</_RequiresTestSdk>

<_RequiresCliArchive>false</_RequiresCliArchive>
<_RequiresCliArchive Condition="'$(RequiresCliArchive)' == 'true'">true</_RequiresCliArchive>

<_GithubActionsRunnerWindows>windows-latest</_GithubActionsRunnerWindows>
<_GithubActionsRunnerWindows Condition="'$(GithubActionsRunnerWindows)' != ''">$(GithubActionsRunnerWindows)</_GithubActionsRunnerWindows>

<_GithubActionsRunnerLinux>ubuntu-latest</_GithubActionsRunnerLinux>
<_GithubActionsRunnerLinux Condition="'$(GithubActionsRunnerLinux)' != ''">$(GithubActionsRunnerLinux)</_GithubActionsRunnerLinux>

<_GithubActionsRunnerMacOS>macos-latest</_GithubActionsRunnerMacOS>
<_GithubActionsRunnerMacOS Condition="'$(GithubActionsRunnerMacOS)' != ''">$(GithubActionsRunnerMacOS)</_GithubActionsRunnerMacOS>

<_TestRunnerWindows>./eng/build.ps1</_TestRunnerWindows>
<_TestRunnerLinux>./eng/build.sh</_TestRunnerLinux>
Expand All @@ -149,9 +153,9 @@
<!-- Replace \ with /, and then escape " with \", so we have a compliant JSON -->
<_TestCommand>$([System.String]::Copy($(_TestCommand)).Replace("\", "/").Replace('&quot;', '\&quot;'))</_TestCommand>

<_TestRunsheetWindows>{ "label": "w: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "windows-latest", "command": "./eng/build.ps1 $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk) }</_TestRunsheetWindows>
<_TestRunsheetLinux>{ "label": "l: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "ubuntu-latest", "command": "./eng/build.sh $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk) }</_TestRunsheetLinux>
<_TestRunsheetMacOS>{ "label": "m: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "macos-latest", "command": "./eng/build.sh $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk) }</_TestRunsheetMacOS>
<_TestRunsheetWindows>{ "label": "w: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "$(_GithubActionsRunnerWindows)", "command": "./eng/build.ps1 $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk), "requiresCliArchive": $(_RequiresCliArchive) }</_TestRunsheetWindows>
<_TestRunsheetLinux>{ "label": "l: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "$(_GithubActionsRunnerLinux)", "command": "./eng/build.sh $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk), "requiresCliArchive": $(_RequiresCliArchive) }</_TestRunsheetLinux>
<_TestRunsheetMacOS>{ "label": "m: $(_TestRunsheet)", "project": "$(_TestRunsheet)", "os": "$(_GithubActionsRunnerMacOS)", "command": "./eng/build.sh $(_TestCommand)", "requiresNugets": $(_RequiresNugets), "requiresTestSdk": $(_RequiresTestSdk), "requiresCliArchive": $(_RequiresCliArchive) }</_TestRunsheetMacOS>
</PropertyGroup>

<WriteLinesToFile
Expand Down
3 changes: 3 additions & 0 deletions eng/Testing.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<!-- Detect if we're running in the context of a GitHub pull request -->
<IsGithubPullRequest Condition="'$(GITHUB_EVENT_NAME)' == 'pull_request'">true</IsGithubPullRequest>

<!-- See https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables -->
<IsGitHubActionsRunner Condition="'$(GITHUB_ACTIONS)' == 'true'">true</IsGitHubActionsRunner>
Comment on lines 12 to +15
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

MSBuild property naming is inconsistent (IsGithubPullRequest vs IsGitHubActionsRunner). Since these properties are consumed across projects/targets, inconsistent casing makes it harder to discover/remember the correct property name and increases the chance of typos. Consider standardizing on a single convention (e.g., IsGitHub*) and (if needed for compatibility) providing an alias property so both spellings resolve to the same value.

Copilot uses AI. Check for mistakes.

<!-- By default any test can run on all test platforms -->
<RunOnGithubActionsWindows>true</RunOnGithubActionsWindows>
<RunOnGithubActionsLinux>true</RunOnGithubActionsLinux>
Expand Down
4 changes: 0 additions & 4 deletions eng/Testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<!--
Environment variables:
- IsGitHubActionsRunner: indicates whether tests are currently run on GitHub Actions; computed, overridable. Locally this can be set by "/p:GITHUB_ACTIONS=true".
- IsAzdoCIRunner: indicates whether tests are currently run on Azure DevOps; computed, overridable. Locally this can be set by "/p:SYSTEM_TEAMPROJECT=foo".
- IsAzdoHelixRunner: indicates whether tests are currently run on Helix; computed, overridable. Locally this can be set by "/p:PrepareForHelix=true".

Expand All @@ -29,9 +28,6 @@
-->

<PropertyGroup>
<!-- See https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables -->
<IsGitHubActionsRunner Condition=" '$(GITHUB_ACTIONS)' == 'true' ">true</IsGitHubActionsRunner>

<!-- See https://learn.microsoft.com/azure/devops/pipelines/build/variables#system-variables -->
<IsAzdoCIRunner Condition=" '$(SYSTEM_TEAMPROJECT)' != '' ">true</IsAzdoCIRunner>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IsTestProject>true</IsTestProject>
<IsUnitTestProject>true</IsUnitTestProject>
<OutputType>Exe</OutputType>
<SkipTests Condition="'$(IsGitHubActionsRunner)' == 'true' and '$(IsGithubPullRequest)' != 'true'">true</SkipTests>

<SplitTestsOnCI>true</SplitTestsOnCI>
<RequiresNugets>true</RequiresNugets>
Expand Down
2 changes: 2 additions & 0 deletions tests/Aspire.EndToEnd.Tests/Aspire.EndToEnd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<SkipTests Condition="'$(IsGitHubActionsRunner)' == 'true' and '$(RunOuterloopTests)' != 'true'">true</SkipTests>
<GithubActionsRunnerLinux>8-core-ubuntu-latest</GithubActionsRunnerLinux>
<!-- Only run on Linux; no docker support on Windows yet -->
<RunOnGithubActionsWindows>false</RunOnGithubActionsWindows>
<RunOnAzdoCIWindows>false</RunOnAzdoCIWindows>
Expand Down
6 changes: 6 additions & 0 deletions tests/Aspire.EndToEnd.Tests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Aspire.TestUtilities;

[assembly: OuterloopTest("EndToEnd tests require Docker and are slow")]
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.

😢

3 changes: 3 additions & 0 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Xunit;
using Aspire.TestProject;
using Aspire.Templates.Tests;
using Aspire.TestUtilities;

namespace Aspire.EndToEnd.Tests;

Expand All @@ -19,6 +20,7 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService
}

[Theory]
[OuterloopTest("EndToEnd tests require Docker and are slow")]
[Trait("scenario", "basicservices")]
[InlineData(TestResourceNames.postgres)]
[InlineData(TestResourceNames.efnpgsql)]
Expand All @@ -42,6 +44,7 @@ public Task VerifyComponentWorks(TestResourceNames resourceName)
});

[Fact]
[OuterloopTest("EndToEnd tests require Docker and are slow")]
[Trait("scenario", "basicservices")]
public Task VerifyHealthyOnIntegrationServiceA()
=> RunTestAsync(async (cancellationToken) =>
Expand Down
Loading