-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Restructure helix project, and targets to work better (#3622)
Currently, `tests/send-to-helix.proj` builds once and constructs various `@(HelixWorkItem)`s for end-to-end tests, and basic tests that don't need a workload. Because of the way Helix SDK works, this ends up sharing some stuff like `HelixPreCommand`, and `HelixPostCommand`. But the different kinds of tests don't need the same pre/post commands, and the targets need to be careful not to step on each other's items/properties. To avoid all this, and keep it clean a new top-level project `tests/send-to-helix-ci.proj` is added which essentially builds the existing project multiple times, once for each test type (called Test Category here). Thus you have: ``` send-to-helix-ci.proj runs the following in parallel: => send-to-helix-inner.proj testCategory=basictests -> send, and wait for the helix jobs => send-to-helix-inner.proj testCategory=endtoendtests -> send, and wait for the helix jobs ``` Co-authored-by: Ankit Jain <radical@gmail.com>
- Loading branch information
1 parent
e45c89a
commit 4976389
Showing
6 changed files
with
97 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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 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,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 |
This file contains 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,35 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<WorkItemArchiveWildCard>$(TestArchiveTestsDir)**/*.zip</WorkItemArchiveWildCard> | ||
<BuildHelixWorkItemsDependsOn>$(BuildHelixWorkItemsDependsOn);BuildHelixWorkItemsForDefaultTests</BuildHelixWorkItemsDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="BuildHelixWorkItemsForDefaultTests" DependsOnTargets="_StageDependenciesForHelix"> | ||
<PropertyGroup> | ||
<_TestRunCommand Condition="'$(RunWithCodeCoverage)' == 'true'">@(_TestCoverageCommand, ' ') "@(_TestRunCommandArguments, ' ')"</_TestRunCommand> | ||
<_TestRunCommand Condition="'$(RunWithCodeCoverage)' != 'true'">@(_TestRunCommandArguments, ' ')</_TestRunCommand> | ||
</PropertyGroup> | ||
|
||
<Error Condition="'$(_DotNetCoverageToolPath)' == '' or !Exists($(_DotNetCoverageToolPath))" | ||
Text="Could not find dotnet-coverage tool. %24(_DotNetCoverageToolPath)=$(_DotNetCoverageToolPath)" /> | ||
|
||
<ItemGroup> | ||
<_DefaultWorkItems Include="$(WorkItemArchiveWildCard)" /> | ||
|
||
<HelixWorkItem Include="@(_DefaultWorkItems -> '%(FileName)')"> | ||
<PayloadArchive>%(Identity)</PayloadArchive> | ||
<PreCommands Condition="'$(OS)' == 'Windows_NT'">set "TEST_NAME=%(FileName)"</PreCommands> | ||
<PreCommands Condition="'$(OS)' != 'Windows_NT'">export "TEST_NAME=%(FileName)"</PreCommands> | ||
<Command>$(_TestRunCommand)</Command> | ||
<Timeout>$(_workItemTimeout)</Timeout> | ||
|
||
<!-- Download results file so coverage files can be extracted --> | ||
<DownloadFilesFromResults>logs/%(FileName).cobertura.xml</DownloadFilesFromResults> | ||
</HelixWorkItem> | ||
</ItemGroup> | ||
|
||
<Message Text="HelixCorrelationPayload: %(HelixCorrelationPayload.Identity)" Condition="'$(HelixDryRun)' == 'true' and @(HelixWorkItem->Count()) > 0" Importance="High" /> | ||
<Message Text="HelixWorkItem: %(HelixWorkItem.Identity), Command: %(HelixWorkItem.Command), PreCommands: %(HelixWorkItem.PreCommands) with PayloadArchive: %(HelixWorkItem.PayloadArchive)" Condition="'$(HelixDryRun)' == 'true' and @(HelixWorkItem->Count()) > 0" Importance="High" /> | ||
</Target> | ||
</Project> |
This file contains 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,17 @@ | ||
<Project> | ||
<Target Name="Test"> | ||
<ItemGroup> | ||
<TestCategory Include="basictests" /> | ||
<TestCategory Condition="'$(OS)' != 'Windows_NT'" Include="endtoendtests" /> | ||
|
||
<_ProjectsToBuild Include="send-to-helix-inner.proj" | ||
Condition="'%(TestCategory.Identity)' != ''" | ||
AdditionalProperties="TestCategory=%(TestCategory.Identity);Configuration=$(Configuration)" /> | ||
</ItemGroup> | ||
|
||
<!-- Invoke MSBuild once for each Category (because of the grouping defined in "_ProjectsToBuild"). | ||
Create the Helix work items and start the jobs. This is done by invoking the "Test" Helix target. | ||
--> | ||
<MSBuild Projects="@(_ProjectsToBuild)" Targets="Test" BuildInParallel="true" StopOnFirstFailure="false" /> | ||
</Target> | ||
</Project> |
This file contains 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 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