diff --git a/eng/pipelines/templates/BuildAndTest.yml b/eng/pipelines/templates/BuildAndTest.yml index ec26c27560..24274aabaa 100644 --- a/eng/pipelines/templates/BuildAndTest.yml +++ b/eng/pipelines/templates/BuildAndTest.yml @@ -63,8 +63,8 @@ steps: # downloaded to /artifacts/helixresults folder. - template: /eng/pipelines/templates/send-to-helix.yml parameters: - HelixProjectPath: '$(Build.SourcesDirectory)/tests/send-to-helix.proj' - HelixProjectArguments: /p:Configuration=${{ parameters.buildConfig }} /p:RunWithCodeCoverage=true /p:RepoTestResultsPath=${{ parameters.repoTestResultsPath }} + HelixProjectPath: '$(Build.SourcesDirectory)/tests/helix/send-to-helix-ci.proj' + HelixProjectArguments: /m /p:Configuration=${{ parameters.buildConfig }} /p:RunWithCodeCoverage=true /p:RepoTestResultsPath=${{ parameters.repoTestResultsPath }} ${{ if eq(parameters.isWindows, 'true') }}: ${{ if eq(variables['System.TeamProject'], 'public') }}: diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000000..900e2fa26b --- /dev/null +++ b/tests/README.md @@ -0,0 +1,6 @@ +# Helix + +The helix CI job builds `tests/helix/send-to-helix-ci.proj`, which in turns builds the `Test` target on `tests/helix/send-to-helix-inner.proj`. This inner project uses the Helix SDK to construct `@(HelixWorkItem)`s, and send them to helix to run. + +- `tests/helix/send-to-helix-basic-tests.targets` - this prepares all the tests that don't need special preparation +- `tests/helix/send-to-helix-workload-tests.targets` - this is for tests that require a sdk+workload installed diff --git a/tests/helix/send-to-helix-basic-tests.targets b/tests/helix/send-to-helix-basic-tests.targets new file mode 100644 index 0000000000..28571f75f5 --- /dev/null +++ b/tests/helix/send-to-helix-basic-tests.targets @@ -0,0 +1,35 @@ + + + + $(TestArchiveTestsDir)**/*.zip + $(BuildHelixWorkItemsDependsOn);BuildHelixWorkItemsForDefaultTests + + + + + <_TestRunCommand Condition="'$(RunWithCodeCoverage)' == 'true'">@(_TestCoverageCommand, ' ') "@(_TestRunCommandArguments, ' ')" + <_TestRunCommand Condition="'$(RunWithCodeCoverage)' != 'true'">@(_TestRunCommandArguments, ' ') + + + + + + <_DefaultWorkItems Include="$(WorkItemArchiveWildCard)" /> + + + %(Identity) + set "TEST_NAME=%(FileName)" + export "TEST_NAME=%(FileName)" + $(_TestRunCommand) + $(_workItemTimeout) + + + logs/%(FileName).cobertura.xml + + + + + + + diff --git a/tests/helix/send-to-helix-ci.proj b/tests/helix/send-to-helix-ci.proj new file mode 100644 index 0000000000..cef601d171 --- /dev/null +++ b/tests/helix/send-to-helix-ci.proj @@ -0,0 +1,17 @@ + + + + + + + <_ProjectsToBuild Include="send-to-helix-inner.proj" + Condition="'%(TestCategory.Identity)' != ''" + AdditionalProperties="TestCategory=%(TestCategory.Identity);Configuration=$(Configuration)" /> + + + + + + diff --git a/tests/send-to-helix.proj b/tests/helix/send-to-helix-inner.proj similarity index 67% rename from tests/send-to-helix.proj rename to tests/helix/send-to-helix-inner.proj index 6051d8be7a..c7fdcf0cb2 100644 --- a/tests/send-to-helix.proj +++ b/tests/helix/send-to-helix-inner.proj @@ -1,10 +1,10 @@ - + + msbuild <_workItemTimeout>00:20:00 - $(TestArchiveTestsDir)**/*.zip true sdk @@ -12,11 +12,11 @@ $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) - BuildHelixWorkItemsForDefaultTests + <_SupportDataStagingDir>$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix', 'support-data')) + _StageDependenciesForHelix - <_SupportDataStagingDir>$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix', 'support-data')) <_HelixLogsPath Condition="'$(OS)' != 'Windows_NT'">$HELIX_WORKITEM_UPLOAD_ROOT/logs <_HelixLogsPath Condition="'$(OS)' == 'Windows_NT'">%HELIX_WORKITEM_UPLOAD_ROOT%/logs @@ -49,35 +49,36 @@ <_TestRunCommandArguments Include="full" /> - + + - - - <_TestRunCommand Condition="'$(RunWithCodeCoverage)' == 'true'">@(_TestCoverageCommand, ' ') "@(_TestRunCommandArguments, ' ')" - <_TestRunCommand Condition="'$(RunWithCodeCoverage)' != 'true'">@(_TestRunCommandArguments, ' ') - + + + - + + - - <_DefaultWorkItems Include="$(WorkItemArchiveWildCard)" /> - - - %(Identity) - set "TEST_NAME=%(FileName)" - export "TEST_NAME=%(FileName)" - $(_TestRunCommand) - $(_workItemTimeout) - - - logs/%(FileName).cobertura.xml - - + + - - - + + + + + + + + + + + + + + + + + @@ -109,6 +110,7 @@ + diff --git a/tests/send-to-helix-workload-tests.targets b/tests/helix/send-to-helix-workload-tests.targets similarity index 51% rename from tests/send-to-helix-workload-tests.targets rename to tests/helix/send-to-helix-workload-tests.targets index e1dba93be0..1f29681eeb 100644 --- a/tests/send-to-helix-workload-tests.targets +++ b/tests/helix/send-to-helix-workload-tests.targets @@ -1,45 +1,16 @@ - $(TestArchiveTestsDirForWorkloadTests)**/*.zip <_E2ETestsArchivePath>$(TestArchiveTestsDirForEndToEndTests)Aspire.EndToEnd.Tests.zip - $(BuildHelixWorkItemsDependsOn);BuildHelixWorkItemsForEnd2EndTests - - - - <_DefaultWorkItemsWorkloadTests Include="$(WorkItemArchiveWildCardWorkloadTests)" /> - - - - - - - - + true - - - - - - - - - - - - - - - - + - - - + + - <_TestScenarioEnvVar Condition="'$(OS)' == 'Windows_NT'">%TEST_SCENARIO% <_TestScenarioEnvVar Condition="'$(OS)' != 'Windows_NT'">${TEST_SCENARIO} @@ -50,7 +21,6 @@ - <_WorkItemTimeoutForEndToEndTests>00:20:00 <_WorkItemName>$([System.IO.Path]::GetFileNameWithoutExtension($(_E2ETestsArchivePath))) $(HelixPreCommands);@(HelixPreCommand) @@ -75,7 +45,7 @@ set "TEST_NAME=$(_WorkItemName)" & set TEST_SCENARIO=%(Identity) & set "CODE_COV_FILE_SUFFIX=-%(Identity)" export "TEST_NAME=$(_WorkItemName)" && export TEST_SCENARIO=%(Identity) && export "CODE_COV_FILE_SUFFIX=-%(Identity)" $(_TestRunCommand) - $(_WorkItemTimeoutForEndToEndTests) + $(_workItemTimeout) logs/Aspire.EndToEnd.Tests-%(Identity).cobertura.xml