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
2 changes: 1 addition & 1 deletion .github/actions/enumerate-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ runs:
"/t:Build;ExtractTestClassNames"
/bl:${{ github.workspace }}/artifacts/log/Debug/BuildTemplatesTests.binlog
-p:ExtractTestClassNamesForHelix=true
-p:ArchiveTests=true
-p:PrepareForHelix=true
-p:ExtractTestClassNamesPrefix=Aspire.Templates.Tests
-p:InstallBrowsersForPlaywright=false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ jobs:
CI: false
run: >
${{ env.BUILD_SCRIPT }} -restore -ci -build -projects ${{ env.TEST_PROJECT_PATH }}
/p:ArchiveTests=true
/bl:${{ github.workspace }}/artifacts/log/Debug/ArchiveTests.binlog
/p:PrepareForHelix=true
/bl:${{ github.workspace }}/artifacts/log/Debug/PrepareForHelix.binlog

# Workaround for bug in Azure Functions Worker SDK. See https://github.com/Azure/azure-functions-dotnet-worker/issues/2969.
- name: Rebuild for Azure Functions project
Expand Down
12 changes: 12 additions & 0 deletions eng/Testing.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<Project>
<PropertyGroup>
<IncludeTestUtilities>true</IncludeTestUtilities>

<!-- By default any test can run on all test platforms -->
<RunOnGithubActionsWindows>true</RunOnGithubActionsWindows>
<RunOnGithubActionsLinux>true</RunOnGithubActionsLinux>
<RunOnAzdoCIWindows>true</RunOnAzdoCIWindows>
<RunOnAzdoCILinux>true</RunOnAzdoCILinux>
<RunOnAzdoHelixWindows>true</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>true</RunOnAzdoHelixLinux>
</PropertyGroup>

<PropertyGroup Condition="'$(UseVSTestRunner)' != 'true'">
<_QuarantinedTestRunAdditionalArgs>-trait "quarantined=true"</_QuarantinedTestRunAdditionalArgs>
<_NonQuarantinedTestRunAdditionalArgs>-notrait "quarantined=true"</_NonQuarantinedTestRunAdditionalArgs>
Expand Down
93 changes: 93 additions & 0 deletions eng/Testing.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
<Project>

<!--
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".

Project capabilities:
- IsTestProject: indicates whether the project is a test project; default is false; computed, overridable.
- IncludeTestUtilities: indicates whether the test project must not include the TestUtilities project reference; default is false; overridable.

Project requirements:
- RunOnGithubActions: indicates whether tests should run on GitHub Actions (either Windows or Linux); computed.
- RunOnGithubActionsWindows: indicates whether tests should run on Windows in GitHub Actions; default is true; overridable.
- RunOnGithubActionsLinux: indicates whether tests should run on Linux in GitHub Actions; default is true; overridable.
- RunOnAzdoCI: indicates whether tests should run on Azure DevOps (either Windows or Linux); always false, if RunOnAzdoHelix=true; computed.
- RunOnAzdoCIWindows: indicates whether tests should run on Windows in Azure DevOps; default is true; overridable.
- RunOnAzdoCILinux: indicates whether tests should run on Linux in Azure DevOps; default is true; overridable.
- RunOnAzdoHelix: indicates whether tests should run on Helix (either Windows or Linux); computed.
- RunOnAzdoHelixWindows: indicates whether tests should run on Windows in Helix; default is true; overridable.
- RunOnAzdoHelixLinux: indicates whether tests should run on Linux in Helix; default is true; overridable.
-->

<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>

<IsAzdoHelixRunner Condition=" '$(PrepareForHelix)' == 'true' ">true</IsAzdoHelixRunner>
</PropertyGroup>

<PropertyGroup>
<RunOnGithubActions>false</RunOnGithubActions>
<RunOnGithubActions Condition=" '$(RunOnGithubActionsWindows)' == 'true' or '$(RunOnGithubActionsLinux)' == 'true' ">true</RunOnGithubActions>
Copy link
Member

@Youssef1313 Youssef1313 Apr 9, 2025

Choose a reason for hiding this comment

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

Is this logic correct?
Shouldn't RunOnGithubActionsWindows be considered only when on Windows, and RunOnGithubActionsLinux be considered only on Linux, instead of ORing them together without any OS checks?

Currently, it seems like Playground is run on GitHub Actions on Windows (VSTest just ignores when no tests are run, but with my PR for MTP I'm getting zero tests ran for Playground)

Could you please double check @RussKie? Am I missing something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the logic is correct.
These variables denote the "capabilities":

Project requirements:
- RunOnGithubActions: indicates whether tests should run on GitHub Actions (either Windows or Linux); computed.
- RunOnGithubActionsWindows: indicates whether tests should run on Windows in GitHub Actions; default is true; overridable.
- RunOnGithubActionsLinux: indicates whether tests should run on Linux in GitHub Actions; default is true; overridable.
- RunOnAzdoCI: indicates whether tests should run on Azure DevOps (either Windows or Linux); always false, if RunOnAzdoHelix=true; computed.
- RunOnAzdoCIWindows: indicates whether tests should run on Windows in Azure DevOps; default is true; overridable.
- RunOnAzdoCILinux: indicates whether tests should run on Linux in Azure DevOps; default is true; overridable.
- RunOnAzdoHelix: indicates whether tests should run on Helix (either Windows or Linux); computed.
- RunOnAzdoHelixWindows: indicates whether tests should run on Windows in Helix; default is true; overridable.
- RunOnAzdoHelixLinux: indicates whether tests should run on Linux in Helix; default is true; overridable.

...and used to generate runsheets, which then executed on individual build agents.

You can see how it is being used in https://github.com/dotnet/aspire/pull/8618/files#diff-ce47bb41900ee3082587fce1184e86392a2c25a05882281792f04e8e8abc51f4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a third look and two cups of tea later, I see the issue now. Thank you for pointing it out.
SkipTests should be OS-aware, so that we don't run a test on Windows, if the test project declared it couldn't be run on Windows. This is getting fixed in #8687.


<RunOnAzdoHelix>false</RunOnAzdoHelix>
<RunOnAzdoHelix Condition=" '$(RunOnAzdoHelixWindows)' == 'true' or '$(RunOnAzdoHelixLinux)' == 'true' ">true</RunOnAzdoHelix>

<RunOnAzdoCI>false</RunOnAzdoCI>
<RunOnAzdoCI Condition=" '$(RunOnAzdoCIWindows)' == 'true' or '$(RunOnAzdoCILinux)' == 'true' ">true</RunOnAzdoCI>
<!-- If a test is run on Helix, then we don't run the test on AzDO -->
<RunOnAzdoCI Condition=" '$(RunOnAzdoHelix)' == 'true' ">false</RunOnAzdoCI>
</PropertyGroup>

<PropertyGroup Condition=" '$(SkipTests)' == '' and '$(IsTestProject)' == 'true' ">
<!-- Skip tests by default unless explicitly set to false -->
<SkipTests>true</SkipTests>

<!-- Only run tests if the build is running on GitHub Actions -->
<SkipTests Condition=" '$(IsGitHubActionsRunner)' == 'true' and '$(RunOnGithubActions)' == 'true' ">false</SkipTests>

<!-- Only run tests if the build is running on Helix infra -->
<SkipTests Condition=" '$(IsAzdoHelixRunner)' == 'true' and '$(RunOnAzdoHelix)' == 'true' ">false</SkipTests>

<!-- Otherwise, run tests on AzDO CI agents -->
<SkipTests Condition=" '$(IsAzdoCIRunner)' == 'true' and '$(RunOnAzdoCI)' == 'true' ">false</SkipTests>
</PropertyGroup>

<ItemGroup Condition=" '$(IsTestProject)' == 'true' and '$(IncludeTestUtilities)' == 'true' ">
<ProjectReference Include="$(RepoRoot)tests\Aspire.TestUtilities\Aspire.TestUtilities.csproj" />
</ItemGroup>

<!--
The following target is used to announce the test capabilities of the project.
-->
<Target Name="_AnnounceProjectTestCapabilities" BeforeTargets="RunTests" Condition="'$(IsTestProject)' == 'true'">
<PropertyGroup>
<_IsGitHubActionsRunner>$(IsGitHubActionsRunner)</_IsGitHubActionsRunner>
<_IsGitHubActionsRunner Condition="'$(_IsGitHubActionsRunner)' == ''">false</_IsGitHubActionsRunner>
<_IsAzdoCIRunner>$(IsAzdoCIRunner)</_IsAzdoCIRunner>
<_IsAzdoCIRunner Condition="'$(_IsAzdoCIRunner)' == ''">false</_IsAzdoCIRunner>
<_IsAzdoHelixRunner>$(IsAzdoHelixRunner)</_IsAzdoHelixRunner>
<_IsAzdoHelixRunner Condition="'$(_IsAzdoHelixRunner)' == ''">false</_IsAzdoHelixRunner>
</PropertyGroup>
<ItemGroup>
<_Runner Include=" - GitHub Actions: $(_IsGitHubActionsRunner)" />
<_Runner Include=" - Azure DevOps: $(_IsAzdoCIRunner)" />
<_Runner Include=" - Helix: $(_IsAzdoHelixRunner)" />
<_Requirement Include=" - GitHub Actions: $(RunOnGithubActions) (Windows: $(RunOnGithubActionsWindows) / Linux: $(RunOnGithubActionsLinux))" />
<_Requirement Include=" - Azure DevOps: $(RunOnAzdoCI) (Windows: $(RunOnAzdoCIWindows) / Linux: $(RunOnAzdoCILinux))" />
<_Requirement Include=" - Helix: $(RunOnAzdoHelix) (Windows: $(RunOnAzdoHelixWindows) / Linux: $(RunOnAzdoHelixLinux))" />
</ItemGroup>

<PropertyGroup>
<_NewLine>%0D%0A</_NewLine>
<_RunnerList>@(_Runner, '%0D%0A')</_RunnerList>
<_RequirementList>@(_Requirement, '$(_NewLine)')</_RequirementList>
</PropertyGroup>

<Message Text="Project: $(MSBuildProjectName)$(_NewLine)Runner Context:$(_NewLine)$(_RunnerList)$(_NewLine)Runner support:$(_NewLine)$(_RequirementList)" />
</Target>

</Project>
2 changes: 1 addition & 1 deletion eng/pipelines/templates/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ steps:
-restore -build
-configuration ${{ parameters.buildConfig }}
-pack
/p:ArchiveTests=${{ lower(eq(parameters.runHelixTests, 'true')) }}
/p:PrepareForHelix=${{ lower(eq(parameters.runHelixTests, 'true')) }}
/bl:${{ parameters.repoLogPath }}/build.binlog
$(_OfficialBuildIdArgs)
displayName: Build
Expand Down
5 changes: 4 additions & 1 deletion tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<RunTestsOnHelix>false</RunTestsOnHelix>

<!-- Do not run tests in Helix at all -->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(ContinuousIntegrationBuild)' == 'true'">true</InstallBrowsersForPlaywright>
<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(OS)' == 'Windows_NT' and '$(ContinuousIntegrationBuild)' != 'true'">true</InstallBrowsersForPlaywright>

<RunTestsOnHelix>false</RunTestsOnHelix>
<!-- Do not run tests in Helix at all -->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>

<!-- Issue: https://github.com/dotnet/aspire/issues/5634 -->
<SkipTests Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</SkipTests>
<RunTestsOnHelix>false</RunTestsOnHelix>
<!-- Do not run tests in Helix at all -->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 4 additions & 5 deletions tests/Aspire.EndToEnd.Tests/Aspire.EndToEnd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<!-- no docker support on helix/windows yet -->
<RunTestsOnHelix Condition="'$(OS)' == 'Windows_NT'">false</RunTestsOnHelix>
<!-- no docker support on GHA/windows yet -->
<RunTestsOnGithubActions Condition="'$(OS)' == 'Windows_NT'">false</RunTestsOnGithubActions>
<SkipTests Condition="'$(OS)' == 'Windows_NT'">true</SkipTests>
<!-- Only run on Linux; no docker support on Windows yet -->
<RunOnGithubActionsWindows>false</RunOnGithubActionsWindows>
<RunOnAzdoCIWindows>false</RunOnAzdoCIWindows>
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>

<!-- no docker support on helix/windows yet -->
<TestUsingWorkloads Condition="! ('$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT')">true</TestUsingWorkloads>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<NoWarn>
$(NoWarn);
ASPIREHOSTINGPYTHON001;
</NoWarn>
<!-- required because DockerComposePublisherTests.PublishAsync_GeneratesValidDockerComposeFile needs
the TestingAppHost1 -->
<RunTestsOnHelix>false</RunTestsOnHelix>
<NoWarn>$(NoWarn);ASPIREHOSTINGPYTHON001;</NoWarn>

<!--
Do not run tests in Helix at all
required because DockerComposePublisherTests.PublishAsync_GeneratesValidDockerComposeFile needs the TestingAppHost1
-->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<RunTestsOnHelix>false</RunTestsOnHelix>

<!-- Do not run tests in Helix at all -->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
CS8002: Referenced assembly does not have a strong name. KubernetesClient package is unsigned, we ignore that warning on purpose
-->
<NoWarn>$(NoWarn);CS8002</NoWarn>
<RunTestsOnHelix>false</RunTestsOnHelix>

<!-- Do not run tests in Helix at all -->
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>
<RunOnAzdoHelixLinux>false</RunOnAzdoHelixLinux>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFrameworks>$(AllTargetFrameworks)</TargetFrameworks>
<RunTestsOnHelix>true</RunTestsOnHelix>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<!-- Set this explicitly so the project can build without arcade -->
<IsTestProject>true</IsTestProject>
<ExcludeTestUtilities>true</ExcludeTestUtilities>
<IncludeTestUtilities>false</IncludeTestUtilities>

<!-- no docker support on helix/windows yet -->
<RunTestsOnHelix Condition="'$(OS)' != 'Windows_NT'">true</RunTestsOnHelix>
<!-- no docker support on GHA/windows yet -->
<RunTestsOnGithubActions Condition="'$(OS)' == 'Windows_NT'">false</RunTestsOnGithubActions>
<SkipTests Condition="'$(OS)' == 'Windows_NT'">true</SkipTests>
<!-- Only run on Linux; no docker support on Windows yet -->
<RunOnGithubActionsWindows>false</RunOnGithubActionsWindows>
<RunOnAzdoCIWindows>false</RunOnAzdoCIWindows>
<RunOnAzdoHelixWindows>false</RunOnAzdoHelixWindows>

<DeployOutsideOfRepoSupportFilesRelativeDir>staging-archive\</DeployOutsideOfRepoSupportFilesRelativeDir>

Expand Down Expand Up @@ -89,7 +88,7 @@
<ProjectReference Include="$(PlaygroundSourceDir)withdockerfile/WithDockerfile.AppHost/WithDockerfile.AppHost.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true'" Label="Prepare archive dir for helix">
<ItemGroup Condition="'$(PrepareForHelix)' == 'true'" Label="Prepare archive dir for helix">
<None Include="$(MSBuildProjectDirectory)\**\*" Link="$(DeployOutsideOfRepoSupportFilesRelativeDir)tests\$(MSBuildProjectName)\%(RecursiveDir)%(FileName)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(RepoRoot)playground\**\*" Link="$(DeployOutsideOfRepoSupportFilesRelativeDir)playground\%(RecursiveDir)%(FileName)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(RepoRoot)src\Aspire.Hosting\Utils\PasswordGenerator.cs" Link="$(DeployOutsideOfRepoSupportFilesRelativeDir)tests\$(MSBuildProjectName)\PasswordGenerator.cs" CopyToOutputDirectory="PreserveNewest" />
Expand Down
4 changes: 2 additions & 2 deletions tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<TestArchiveTestsDir>$(TestArchiveTestsDirForTemplateTests)</TestArchiveTestsDir>

<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(CODESPACES)' == 'true'">true</InstallBrowsersForPlaywright>
<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(ArchiveTests)' == 'true' and '$(ContinuousIntegrationBuild)' == 'true'">true</InstallBrowsersForPlaywright>
<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(PrepareForHelix)' == 'true' and '$(ContinuousIntegrationBuild)' == 'true'">true</InstallBrowsersForPlaywright>
<InstallBrowsersForPlaywright Condition="'$(InstallBrowsersForPlaywright)' == '' and '$(OS)' == 'Windows_NT' and '$(ContinuousIntegrationBuild)' != 'true'">true</InstallBrowsersForPlaywright>

<ExtractTestClassNamesForHelix Condition="'$(ContinuousIntegrationBuild)' == 'true' or '$(ArchiveTests)' == 'true'">true</ExtractTestClassNamesForHelix>
<ExtractTestClassNamesForHelix Condition="'$(ContinuousIntegrationBuild)' == 'true' or '$(PrepareForHelix)' == 'true'">true</ExtractTestClassNamesForHelix>
<ExtractTestClassNamesPrefix>Aspire.Templates.Tests</ExtractTestClassNamesPrefix>

<!--
Expand Down
17 changes: 4 additions & 13 deletions tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@

<Import Project="$(TestsSharedRepoTestingDir)Aspire.RepoTesting.targets" />

<ItemGroup Condition=" '$(IsTestProject)' == 'true' and '$(ExcludeTestUtilities)' != 'true' ">
<ProjectReference Include="$(RepoRoot)tests\Aspire.TestUtilities\Aspire.TestUtilities.csproj" />
</ItemGroup>

<PropertyGroup>
<!-- forward the settings file path to RunTests target in arcade -->
<VSTestRunSettingsFile Condition="'$(VSTestRunSettingsFile)' == ''">$(RunSettingsFilePath)</VSTestRunSettingsFile>

<DeployRunSettingsFile Condition="'$(DeployRunSettingsFile)' == ''">true</DeployRunSettingsFile>
<!-- Use a separate xunit.runner.json for helix that disables parallel test runs -->
<XunitRunnerJson Condition="'$(XunitRunnerJson)' == '' and '$(ArchiveTests)' == 'true'">$(RepoRoot)tests\helix\xunit.runner.json</XunitRunnerJson>
<XunitRunnerJson Condition="'$(XunitRunnerJson)' == '' and '$(PrepareForHelix)' == 'true'">$(RepoRoot)tests\helix\xunit.runner.json</XunitRunnerJson>
<XunitRunnerJson Condition="'$(XunitRunnerJson)' == ''">$(RepositoryEngineeringDir)testing\xunit.runner.json</XunitRunnerJson>

<RunTestsOnGithubActions Condition="'$(RunTestsOnGithubActions)' == '' and ('$(IsTestProject)' == 'true' and '$(IsTestUtilityProject)' != 'true')">true</RunTestsOnGithubActions>
<RunTestsOnHelix Condition="'$(RunTestsOnHelix)' == '' and ('$(IsTestProject)' == 'true' and '$(IsTestUtilityProject)' != 'true')">true</RunTestsOnHelix>
<!-- this is for pipeline tests -->
<SkipTests Condition="'$(SkipTests)' == '' and ('$(IsTestUtilityProject)' == 'true' or '$(RunTestsOnHelix)' == 'true')">true</SkipTests>
</PropertyGroup>

<ItemGroup>
Expand All @@ -28,7 +19,7 @@
</ItemGroup>

<Target Name="ZipTestArchive" AfterTargets="Build"
Condition="'$(ArchiveTests)' == 'true' and '$(RunTestsOnHelix)' == 'true' and '$(IsTestUtilityProject)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">
Condition=" '$(IsTestProject)' == 'true' and '$(PrepareForHelix)' == 'true' and '$(RunOnAzdoHelix)' == 'true' and '$(IsTestUtilityProject)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">
<Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." />
<PropertyGroup>
<TestsArchiveSourceDir Condition="'$(TestsArchiveSourceDir)' == ''">$(OutDir)</TestsArchiveSourceDir>
Expand All @@ -44,7 +35,7 @@

<!-- Used for running one helix job per test class -->
<Target Name="ExtractTestClassNames"
Condition="'$(ExtractTestClassNamesForHelix)' == 'true' and '$(ArchiveTests)' == 'true' and '$(IsTestUtilityProject)' != 'true'"
Condition=" '$(IsTestProject)' == 'true' and '$(ExtractTestClassNamesForHelix)' == 'true' and '$(PrepareForHelix)' == 'true' and '$(IsTestUtilityProject)' != 'true'"
BeforeTargets="ZipTestArchive">

<Error Condition="'$(ExtractTestClassNamesPrefix)' == ''"
Expand Down Expand Up @@ -75,7 +66,7 @@

<Target Name="GetRunTestsOnGithubActions" Returns="@(TestProject)">
<ItemGroup>
<TestProject Include="$(MSBuildProjectFullPath)" RunTestsOnGithubActions="$(RunTestsOnGithubActions)" />
<TestProject Include="$(MSBuildProjectFullPath)" RunTestsOnGithubActions="$(RunOnGithubActions)" />
</ItemGroup>
</Target>

Expand Down
Loading
Loading