Merged PR 543058: Setup infrastructure to run CloudTests tests that run during our CI as well as can run in our PR validation.

This PR will finish the instrastruture needed to run tests in cloudtest from our repo.
* There is an optional CloudTest validation step in the PR. Currently called `CloudTest validation (Gvfs)`.
  - If we do anything to the change detection logic we should manually run this.
* If you change anything under the CloudTest folder a sibbling validation will be automatically kicked off and is marked required called `CloudTest validation (Gvfs) - Required`
* There is a validation step in our CI between the Dogfood and Canary stages called `Cg: CloudTest validation (gvfs)`
  - This one is currently marked as optional until we have enough confidence in the signal and can make it required.

The infrastructure has been set up in that it is not just for Gvfs validation. Future CloudTest tests can simply be added as a sibbling under the `private\CloudTest` folder following the gvfs tests pattern and following the user guide on `http://aka.ms/CloudTest` on how to edit the xml files.
If we add more  I would recommend naming the queue and the jobs in the pr validation and CI to reflect this.
This commit is contained in:
Danny van Velzen 2020-03-27 03:21:00 +00:00
Родитель ffb259fba5
Коммит 02bbc35e10
7 изменённых файлов: 21 добавлений и 18 удалений

Просмотреть файл

Просмотреть файл

@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestJobGroup>
<ResourceSpec>
<Resource Image="Windows-10" SKU="19h1-pro"/>
<Resource Image="2019-Datacenter" SKU="Standard_D2s_v3"/>
</ResourceSpec>
<Setup TimeoutMins="3">
<BuildFiles>
<Copy IsRecursive="true" Dest="[WorkingDirectory]\" Src="[BuildRoot]\CloudTest\[BuildType]\Gvfs\*"/>
</BuildFiles>
<Scripts>
<Script Path="[WorkingDirectory]\setup.cmd" Args="" />
</Scripts>
</Setup>
<TestJob OwnerAliases="buildxl-cloudtest" Name="BuildXL.CloudTest.Gvfs">
<Execution Path="[WorkingDirectory]\BuildXL.CloudTest.Gvfs.dll" Type="Xunit"/>
<Execution Type="Exe" Path="c:\dotnet\dotnet.exe" Args=" [WorkingDirectory]\xunit.console.dll [WorkingDirectory]\BuildXL.CloudTest.Gvfs.dll -noshadow -noappdomain -xml [LoggingDirectory]\testResult.xunit.xml -html [LoggingDirectory]\testResults.html -nunit [LoggingDirectory]\testResult.xml" Parser="NUnitXml"/>
</TestJob>
<Cleanup TimeoutMins="3"/>

Просмотреть файл

@ -23,5 +23,7 @@ export const dll = BuildXLSdk.library({
],
runtimeContent: [
f`BuildXL.CloudTest.Gvfs.JobGroup.xml`,
f`setup.cmd`,
...importFrom("Sdk.Managed.Testing.XUnit").additionalNetCoreRuntimeContent,
]
});

Просмотреть файл

@ -0,0 +1,2 @@
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -channel LTS -installdir c:\dotnet"

Просмотреть файл

@ -8,12 +8,6 @@ namespace BuildXL.CloudTest.Gvfs
{
public class TestSample
{
[Fact]
public void SampleFail()
{
Assert.True(false, "Testing failure");
}
[Fact]
public void SamplePass()
{

Просмотреть файл

@ -148,7 +148,7 @@ function runMultipleConsoleTests(args: TestRunArguments) : Result
// Avoid double-writes
xmlFile: renameOutputFile(testGroup, args.xmlFile),
xmlV1File: renameOutputFile(testGroup, args.xmlV1File),
xmlFnunitFileile: renameOutputFile(testGroup, args.nunitFile),
nunitFile: renameOutputFile(testGroup, args.nunitFile),
htmlFile: renameOutputFile(testGroup, args.htmlFile),
traits: [

Просмотреть файл

@ -54,17 +54,19 @@ const xunitConsoleRuntimeConfigFiles: File[] = Managed.RuntimeConfigFiles.create
undefined // nopappConfig
);
@@public
export const additionalNetCoreRuntimeContent =
[
// Unfortunately xUnit console runner comes as a precompiled assembly for .NET Core, we could either go and package it
// into a self-contained deployment or treat it as a framework-dependent deployment as intended, let's do the latter
...xunitConsoleRuntimeConfigFiles,
xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.dll`),
xunitNetCoreConsolePackage.getFile(r`/lib/netcoreapp2.0/xunit.console.dll`)
];
// For the DotNetCore run we need to copy a bunch more files:
function additionalRuntimeContent(args: Managed.TestArguments) : Deployment.DeployableItem[] {
return isDotNetCore
? [
// Unfortunately xUnit console runner comes as a precompiled assembly for .NET Core, we could either go and package it
// into a self-contained deployment or treat it as a framework-dependent deployment as intended, let's do the latter
...xunitConsoleRuntimeConfigFiles,
xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.dll`),
xunitNetCoreConsolePackage.getFile(r`/lib/netcoreapp2.0/xunit.console.dll`)
]
: [];
return isDotNetCore ? additionalNetCoreRuntimeContent : [];
}
function runTest(args : TestRunArguments) : File[] {