Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add a "Helix Test" step to the official build definitions #15177

Merged
merged 11 commits into from
Jan 18, 2017
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
12 changes: 12 additions & 0 deletions Tools-Override/Build.Post.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="CloudBuild" Condition="'$(EnableCloudTest)' != 'true'" />

<!--
enables cloud-distributed testing. please see target VerifyInputs
in CloudTest.targets for the complete list of required properties.
-->
<Import Project="$(MSBuildThisFileDirectory)CloudTest.targets" Condition="'$(EnableCloudTest)' == 'true'" />

</Project>
2 changes: 1 addition & 1 deletion Tools-Override/CloudTest.targets
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@

<Target Name="CompressRuntimeDir" Condition="'$(SkipArchive)' != 'true'">
<ZipFileCreateFromDirectory
SourceDirectory="$(RuntimePath)"
SourceDirectory="$(TestSharedFxDir)"
DestinationArchive="$(TestRuntimeArchiveFile)"
OverwriteDestination="true" />
<ItemGroup>
Expand Down
14 changes: 10 additions & 4 deletions Tools-Override/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@

<PropertyGroup>
<XunitRuntimeConfig>$(ToolsDir)\xunit.console.netcore.runtimeconfig.json</XunitRuntimeConfig>
<TestHostExecutablePath Condition="'$(OS)'=='Windows_NT' AND '$(TestHostExecutablePath)' == ''">$(TestSharedFxDir)\dotnet.exe</TestHostExecutablePath>
<TestHostExecutablePath Condition="'$(OS)'!='Windows_NT' AND '$(TestHostExecutablePath)' == ''">$(TestSharedFxDir)\dotnet</TestHostExecutablePath>
<XunitExecutable Condition="'$(XunitExecutable)' == ''">$(TestPath)\xunit.console.netcore.exe</XunitExecutable>
<TestRuntimeEnvVar Condition="'$(OS)' == 'Windows_NT'">%RUNTIME_PATH%\</TestRuntimeEnvVar>
Copy link
Member

Choose a reason for hiding this comment

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

We should probably be using TargetOS here instead of OS. I actually I would like us to capture this condition in one common place in this file instead of duplicating everywhere. Doing it based on OS will not enable us to do a cross-test build on Windows to run on a unix machine.

Copy link
Member

Choose a reason for hiding this comment

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

I filed issue https://github.com/dotnet/corefx/issues/15305 to clean up these usages of OS property.

<TestRuntimeEnvVar Condition="'$(OS)' != 'Windows_NT'">$RUNTIME_PATH/</TestRuntimeEnvVar>
Copy link
Member

Choose a reason for hiding this comment

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

Why did we call this runtimepath? It is a little miss-leading as we do have a RuntimePath which isn't this directory. This is really the testdotnetcli directory.

Copy link
Contributor Author

@mellinoe mellinoe Jan 19, 2017

Choose a reason for hiding this comment

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

we do have a RuntimePath which isn't this directory

It used to be, but isn't anymore. I tried to clean things up when we moved over to dotnet.exe, but the name of this variable wasn't updated.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please file an issue to clean this up?

<TestHostExecutablePath Condition="'$(OS)'=='Windows_NT' AND '$(TestHostExecutablePath)' == ''">$(TestRuntimeEnvVar)dotnet.exe</TestHostExecutablePath>
<TestHostExecutablePath Condition="'$(OS)'!='Windows_NT' AND '$(TestHostExecutablePath)' == ''">$(TestRuntimeEnvVar)dotnet</TestHostExecutablePath>

<ExecutionDirEnvVar Condition="'$(OS)' == 'Windows_NT'">%EXECUTION_DIR%\</ExecutionDirEnvVar>
<ExecutionDirEnvVar Condition="'$(OS)' != 'Windows_NT'">$EXECUTION_DIR/</ExecutionDirEnvVar>
<XunitExecutable Condition="'$(XunitExecutable)' == ''">$(ExecutionDirEnvVar)xunit.console.netcore.exe</XunitExecutable>

<DebugEngines>{2E36F1D4-B23C-435D-AB41-18E608940038}</DebugEngines>
</PropertyGroup>

Expand Down Expand Up @@ -188,7 +194,7 @@

<MakeDir Condition="'$(CoverageEnabledForProject)'=='true'" Directories="$(CoverageReportDir)" />

<Exec Command="$(TestPath)/$(RunnerScriptName) $(RuntimePath)"
<Exec Command="$(TestPath)/$(RunnerScriptName) $(TestSharedFxDir)"
CustomErrorRegularExpression="Failed: [^0]"
ContinueOnError="true"
IgnoreStandardErrorWarningFormat="true"
Expand Down
24 changes: 23 additions & 1 deletion buildpipeline/DotNet-CoreFx-Trusted-Linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,25 @@
},
"inputs": {
"filename": "docker",
"arguments": "exec $(PB_DockerContainerName) $(PB_GitDirectory)/build-tests.sh -buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests",
"arguments": "exec $(PB_DockerContainerName) $(PB_GitDirectory)/build-tests.sh -buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests -- /p:ArchiveTests=true",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Create Helix Test Jobs",
"timeoutInMinutes": 0,
"task": {
"id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "docker",
"arguments": "exec $(PB_DockerContainerName) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/src/tests.builds /t:CloudBuild /p:ArchGroup=$(PB_Platform) /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:\"EnableCloudTest=$(PB_EnableCloudTest)\" /p:\"BuildMoniker=$(PB_BuildMoniker)\" /p:\"TargetQueue=$(PB_TargetQueue)\" /p:\"TestProduct=$(PB_TestProduct)\" /p:\"Branch=$(SourceBranch)\" /p:\"CloudDropAccountName=$(PB_CloudDropAccountName)\" /p:\"CloudResultsAccountName=$(PB_CloudResultsAccountName)\" /p:\"CloudDropAccessToken=$(CloudDropAccessToken)\" /p:\"CloudResultsAccessToken=$(OutputCloudResultsAccessToken)\" /p:\"TimeoutInSeconds=1200\" /p:\"TargetOS=Linux\" /p:FilterToOSGroup=Linux /p:\"HelixApiAccessKey=$(HelixApiAccessKey)\" /p:HelixApiEndpoint=$(PB_HelixApiEndPoint)",
Copy link
Member

Choose a reason for hiding this comment

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

Not a requirement, or blocker for your work. Something we might want to consider is abstracting these command-lines even further out of the build definitions. ie, if this line just became...

exec $(PB_DockerContainerName) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_CreateHelixTestArguments)

Then, then entire task can be completely customized just by passing a $(PB_CreateHelixTestArguments) parameter in the DotNet-CoreFx-Trusted-Linux definition section of pipeline.json, and our individual build definition becomes even more generic.

"workingFolder": "",
"failOnStandardError": "false"
}
Expand Down Expand Up @@ -441,6 +459,10 @@
},
"PB_AdditionalArguments": {
"value": ""
},
"PB_EnableCloudTest": {
"value": "true",
"allowOverride": true
}
},
"demands": [
Expand Down
25 changes: 23 additions & 2 deletions buildpipeline/DotNet-CoreFx-Trusted-OSX.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,29 @@
},
"inputs": {
"filename": "$(Agent.BuildDirectory)/s/corefx/build-tests.sh",
"arguments": "-buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests",
"arguments": "-buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests -- /p:ArchiveTests=true",
"workingFolder": "$(Agent.BuildDirectory)/s/corefx/",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Create Helix Test Jobs",
"timeoutInMinutes": 0,
"task": {
"id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "$(Agent.BuildDirectory)/s/corefx/Tools/msbuild.sh",
"arguments": "$(Agent.BuildDirectory)/s/corefx/src/tests.builds /t:CloudBuild /p:ArchGroup=$(PB_Platform) /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:\"EnableCloudTest=$(PB_EnableCloudTest)\" /p:\"BuildMoniker=$(PB_BuildMoniker)\" /p:\"TargetQueue=$(PB_TargetQueue)\" /p:\"TestProduct=$(PB_TestProduct)\" /p:\"Branch=$(SourceBranch)\" /p:\"CloudDropAccountName=$(PB_CloudDropAccountName)\" /p:\"CloudResultsAccountName=$(PB_CloudResultsAccountName)\" /p:\"CloudDropAccessToken=$(CloudDropAccessToken)\" /p:\"CloudResultsAccessToken=$(OutputCloudResultsAccessToken)\" /p:\"TimeoutInSeconds=1200\" /p:\"TargetOS=OSX\" /p:FilterToOSGroup=OSX /p:\"HelixApiAccessKey=$(HelixApiAccessKey)\" /p:HelixApiEndpoint=$(PB_HelixApiEndPoint)",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
Expand Down Expand Up @@ -262,6 +280,10 @@
},
"Build.Clean": {
"value": "all"
},
"PB_EnableCloudTest": {
"value": "true",
"allowOverride": true
}
},
"demands": [
Expand Down Expand Up @@ -303,7 +325,6 @@
"checkoutSubmodules": false
},
"quality": "definition",
"defaultBranch": "refs/heads/master",
"queue": {
"pool": {
"id": 39,
Expand Down
33 changes: 32 additions & 1 deletion buildpipeline/DotNet-CoreFx-Trusted-Windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,38 @@
},
"inputs": {
"filename": "$(Build.SourcesDirectory)\\corefx\\build-tests.cmd",
"arguments": "-buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests -- /p:RuntimeOS=$(PB_RuntimeOS)",
"arguments": "-buildArch=$(PB_Platform) -$(PB_ConfigurationGroup) -SkipTests -- /p:RuntimeOS=$(PB_RuntimeOS) /p:ArchiveTests=true",
"workingFolder": "corefx",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Create Helix Test Jobs",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "$(Build.SourcesDirectory)\\corefx\\src\\tests.builds",
"platform": "",
"configuration": "",
"msbuildArguments": "/t:CloudBuild /p:ArchGroup=$(PB_Platform) /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:\"EnableCloudTest=$(PB_EnableCloudTest)\" /p:\"BuildMoniker=$(PB_BuildMoniker)\" /p:\"TargetQueue=$(PB_TargetQueue)\" /p:\"TestProduct=$(PB_TestProduct)\" /p:\"Branch=$(SourceBranch)\" /p:\"CloudDropAccountName=$(PB_CloudDropAccountName)\" /p:\"CloudResultsAccountName=$(PB_CloudResultsAccountName)\" /p:\"CloudDropAccessToken=$(CloudDropAccessToken)\" /p:\"CloudResultsAccessToken=$(OutputCloudResultsAccessToken)\" /p:\"TimeoutInSeconds=1200\" /p:\"TargetOS=Windows_NT\" /p:FilterToOSGroup=Windows_NT /p:\"HelixApiAccessKey=$(HelixApiAccessKey)\" /p:HelixApiEndpoint=$(PB_HelixApiEndPoint)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "14.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
Expand Down Expand Up @@ -427,6 +454,10 @@
},
"PB_SymbolsBuildId": {
"value": "DotNet-CoreFx-$(System.DefinitionId)"
},
"PB_EnableCloudTest": {
"value": "true",
"allowOverride": true
}
},
"demands": [
Expand Down
Loading