Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to VSTest in CI #39923

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
838ddae
Switch to VSTest in CI and remove xunit.console
ViktorHofer Jul 25, 2020
1e2834f
Fix GenerateRunScript sequencing
ViktorHofer Jul 25, 2020
9a37bf5
Update docs and other usages
ViktorHofer Jul 26, 2020
c255ed7
fixessss
ViktorHofer Jul 26, 2020
c2a244c
better syntax
ViktorHofer Jul 26, 2020
8902245
runsettings file path fix
ViktorHofer Jul 26, 2020
c3e4655
DotNetHostPath fix
ViktorHofer Jul 26, 2020
6923c2d
Runsettings building in CI
ViktorHofer Jul 27, 2020
9410004
Fix casing of outerBuild
ViktorHofer Jul 27, 2020
b44b1db
Respect MonoEnvOptions
ViktorHofer Jul 27, 2020
2d43525
Respect MonoEnvOptions correctly
ViktorHofer Jul 27, 2020
a6cfd27
Use the publish output instead of the bin
ViktorHofer Jul 30, 2020
043c74f
Update docs/workflow/testing/libraries/testing.md
ViktorHofer Jul 31, 2020
5084f08
Code cleanup
ViktorHofer Aug 1, 2020
556937c
set VSTEST_DUMP_PATH
ViktorHofer Aug 26, 2020
1a2f4e1
update helix variable
ViktorHofer Aug 27, 2020
3a05f4d
Progress
ViktorHofer Sep 10, 2020
2931e64
Cleanup & fixes
ViktorHofer Sep 10, 2020
e8aaedc
Include runner xunit assemblies
ViktorHofer Sep 10, 2020
dd43a37
Update helix SDK to avoid dotnet cli collision
safern Sep 11, 2020
fba9fcc
Publish .runsettings file and nit coverage fixes
ViktorHofer Sep 12, 2020
92eac51
Fix runner copying and dotnet path
ViktorHofer Sep 13, 2020
6b661ac
Fix code coverage and XmlSerializer.Generator
ViktorHofer Sep 13, 2020
e2459e9
Set vstest_dump_path correctly
ViktorHofer Sep 13, 2020
150b3f6
wasm template invocation fix
ViktorHofer Sep 13, 2020
e01052c
fix WasmRunnerTemplate args
ViktorHofer Sep 13, 2020
912259d
Update helix sdk again
ViktorHofer Sep 15, 2020
769530e
Merge branch 'master' into DotNetTestRemoveXunitConsole
ViktorHofer Sep 15, 2020
3b660ea
Merge branch 'master' into DotNetTestRemoveXunitConsole
ViktorHofer Sep 15, 2020
a4a1e9f
Merge branch 'master' into DotNetTestRemoveXunitConsole
ViktorHofer Sep 25, 2020
70aa76f
Ignore VSTest enabled event sources
ViktorHofer Sep 25, 2020
1597390
Make DebugTests robust against runners with custom trace listeners
ViktorHofer Sep 25, 2020
6b69974
Don't set TargetPlatform in the runsettings file
ViktorHofer Sep 29, 2020
ef72bff
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Sep 30, 2020
66266e8
Pass --runtime switch to dotnet test
ViktorHofer Sep 30, 2020
2799d3a
Ordering of HelixCommand
ViktorHofer Sep 30, 2020
ee23a22
Remove targetplatform from .runsettings file as well
ViktorHofer Sep 30, 2020
24ff601
set platform
ViktorHofer Sep 30, 2020
cc32293
Remove TestSessionTimeout
ViktorHofer Sep 30, 2020
689af35
Update RemoteExecutor
ViktorHofer Oct 1, 2020
7e1b030
System.Console extra logging
ViktorHofer Oct 1, 2020
7a3473b
interop everywhere
ViktorHofer Oct 1, 2020
69ea02d
Grr fix
ViktorHofer Oct 1, 2020
511a9a3
Disable OutputEncodingPreamble test on nano
ViktorHofer Oct 1, 2020
cc171f0
more logging
ViktorHofer Oct 1, 2020
a1c45cb
Avoid sdk dependency
ViktorHofer Oct 1, 2020
9c1dafe
rollforward fix
ViktorHofer Oct 1, 2020
c5b3a4c
Fix binplacing
ViktorHofer Oct 1, 2020
93c392f
vstest fixes
ViktorHofer Oct 1, 2020
e7bb831
Patch VSTest's runtimeconfig files
ViktorHofer Oct 2, 2020
8c90501
Fix .NETFramework invocation
ViktorHofer Oct 2, 2020
01fd323
NetFramework fixes
ViktorHofer Oct 2, 2020
c62a99e
Test fixes and wasm fixes
ViktorHofer Oct 5, 2020
8146f67
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Oct 5, 2020
9a0a1fa
Fix test code
ViktorHofer Oct 6, 2020
0e1799d
Pass traits to wasm run invocation
ViktorHofer Oct 6, 2020
a953524
REvert WindowAndCursorProps changes
ViktorHofer Oct 6, 2020
3f46d72
Remove unnecessary test condition
ViktorHofer Oct 6, 2020
e102284
Update eng/testing/mobile/WasmRunnerTemplate.sh
ViktorHofer Oct 6, 2020
95f2738
Handle behavior difference for Win7x86 Console tests
ViktorHofer Oct 7, 2020
c91989e
Merge branch 'DotNetTestRemoveXunitConsole' of https://github.com/Vik…
ViktorHofer Oct 7, 2020
b033e37
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Oct 10, 2020
9e01265
Disable Mono Windows test invocation
ViktorHofer Oct 10, 2020
7999fb9
Disable test on nano
ViktorHofer Oct 10, 2020
68d0ae5
Set the hang dump timeout in the test submission
ViktorHofer Oct 11, 2020
45e9b59
Format work item timeout correctly
ViktorHofer Oct 12, 2020
b2bf360
Add xunit.console back until VSTest lightweight
ViktorHofer Oct 13, 2020
5944644
Add docs for alternative test runner
ViktorHofer Oct 13, 2020
787a7e0
Merge branch 'master' into DotNetTestRemoveXunitConsole
ViktorHofer Oct 13, 2020
46fd013
Protect xunit test runner in CI
ViktorHofer Oct 13, 2020
826b166
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Oct 13, 2020
3dc00a5
Fix yml indentation
ViktorHofer Oct 13, 2020
442f14e
Fix yml again
ViktorHofer Oct 13, 2020
1918ec5
Yml again
ViktorHofer Oct 13, 2020
da53320
Fix yml and dump timeout
ViktorHofer Oct 14, 2020
639ed55
Increase timeout for extra testing job
ViktorHofer Oct 14, 2020
be71392
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Oct 14, 2020
b68d4ba
Merge remote-tracking branch 'upstream/master' into DotNetTestRemoveX…
ViktorHofer Oct 18, 2020
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 docs/coding-guidelines/adding-api-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ should be added to `net5.0`. [More Information on TargetFrameworks](https://docs
**Update tests**
- Add new `TargetFramework` to the ```TargetFrameworks```.
- Add new test code following [conventions](project-guidelines.md#code-file-naming-conventions) for new files to that are specific to the new target framework.
- To run just the new test targetFramework run `dotnet build <Library>.csproj -f <TargetFramework> /t:Test`. TargetFramework should be chosen only from supported TargetFrameworks.
- To run just the new test targetFramework run `dotnet test <Library>.csproj -f <TargetFramework>`. TargetFramework should be chosen only from supported TargetFrameworks.

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions docs/workflow/building/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cd tests

:: Then inner loop build / test
:: (If using Visual Studio, you might run tests inside it instead)
pushd ..\src & dotnet build & popd & dotnet build /t:test
pushd ..\src & dotnet build & popd & dotnet test
```

The instructions for Linux and macOS are essentially the same:
Expand All @@ -43,7 +43,7 @@ cd src/libraries/System.Text.RegularExpressions
cd tests

# Then inner loop build / test:
pushd ../src & dotnet build & popd & dotnet build /t:test
pushd ../src & dotnet build & popd & dotnet test
```

The steps above may be all you need to know to make a change. Want more details about what this means? Read on.
Expand Down
6 changes: 3 additions & 3 deletions docs/workflow/building/libraries/code-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ This runs the tests and generates the full code coverage report. The resulting i

artifacts\coverage\index.htm

You can also build and test with code coverage for a particular test project rather than for the whole repo with the `/p:Coverage=true` property:
You can also build and test with code coverage for a particular test project rather than for the whole repo with the `--collect:"XPlat Code Coverage"` switch:

dotnet build /t:Test /p:Coverage=true
dotnet test --collect:"XPlat Code Coverage"
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved

The results for this one library will then be available in this index.htm file, where $(OutDir) is the directory where the binaries were generated.

$(OutDir)\report\index.htm

For example, to build, test, and get code coverage results for the System.Diagnostics.Debug library, from the root of the repo one can do:

dotnet build src\System.Diagnostics.Debug\tests /t:Test /p:Coverage=true
dotnet test src\System.Diagnostics.Debug\tests --collect:"XPlat Code Coverage"

And then once the run completes:

Expand Down
11 changes: 6 additions & 5 deletions docs/workflow/debugging/libraries/debugging-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Build:

To validate the content of the nupkg, change the extension to .zip. As before, use an IL disassembler to verify that the right APIs are present within `ref\<platform>\contractname.dll` and the right implementations within the `lib\<platform>\contractname.dll`.

4. Run the tests from `\tests`: `dotnet build /t:test`
4. Run the tests from `\tests`: `dotnet test`

Ensure that the test is referencing the correct pkg. For example:
```
Expand All @@ -96,10 +96,11 @@ ResolvePkgProjReferences:
To run a test from a single Build Pivot combination, specify all properties and build the `csproj`:

```
dotnet build System.Net.ServicePoint.Tests.csproj -f netcoreapp2.0 /t:test /p:OuterLoop=true /p:xunitoptions=-showprogress
dotnet test System.Net.ServicePoint.Tests.csproj -f net5.0 /p:OuterLoop=true
```
Will run the test using the following pivot values:
* Architecture: AnyCPU
* Flavor: Debug
* OS: Windows_NT
* Target: netstandard2.0
* Configuration: Debug
* TargetOS: Windows_NT
* TargetFramework: net5.0
* OuterLoop: true
2 changes: 1 addition & 1 deletion docs/workflow/debugging/libraries/unix-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CoreFX can be debugged on unix using both lldb and visual studio code

## Using lldb and SOS

- Run the test using msbuild at least once with `/t:Test`.
- Run the test using the SDK at least once with `dotnet test`.
- [Install version 3.9 of lldb](../coreclr/debugging.md#debugging-core-dumps-with-lldb) and launch lldb with dotnet as the process and arguments matching the arguments used when running the test through msbuild.
- Load the sos plugin using `plugin load libsosplugin.so`.
- Type `soshelp` to get help. You can now use all sos commands like `bpmd`.
Expand Down
18 changes: 3 additions & 15 deletions docs/workflow/debugging/libraries/windows-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,10 @@ You may need to do this for both x64 and x86 versions.
Any application that crashes should now automatically start a WinDBG session.

## Debugging tests
To run a single test from command line:

* Locate the test binary folder based on the CSPROJ name.

For example: `src\System.Net.Sockets\tests\Functional\System.Net.Sockets.Tests.csproj` will build and output binaries at `bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0`.

* Execute the test

Assuming that your repo is at `C:\corefx`:
Assuming that your repo is at `C:\runtime`:

```
cd C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0
C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0\CoreRun.exe xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing
dotnet test C:\runtime\src\libraries\System.Net.Sockets\tests
```

* If the test crashes or encounters a `Debugger.Launch()` method call, WinDBG will automatically start and attach to the `CoreRun.exe` process
Expand All @@ -52,7 +43,7 @@ The following commands will properly configure the debugging extension and fix s
.symfix
.srcfix
.reload
!load C:\corefx\packages\runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\<version>\tools\sos
!load C:\runtime\coreclr\runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\<version>\tools\sos
```

_Important_: Pass in the correct path to your SOS extension discovered during the Prerequisites, step 2.
Expand Down Expand Up @@ -168,6 +159,3 @@ Helper scripts are available at https://github.com/dotnet/runtime/tree/master/sr
* `*System.Threading.Tasks.TplEventSource {2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5}`: Provides an event source for tracing TPL information.
* `*System.Threading.Tasks.Parallel.EventSource`: Provides an event source for tracing TPL information.
* `*System.Threading.Tasks.Dataflow.DataflowEventSource {16F53577-E41D-43D4-B47E-C17025BF4025}`: Provides an event source for tracing Dataflow information.

## Notes
* You can find the test invocation command-line by looking at the logs generated after the `dotnet build /t:test` within the test folder.
20 changes: 9 additions & 11 deletions docs/workflow/testing/libraries/filtering-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ The tests can be filtered based on xunit trait attributes defined in [`Microsoft
#### OuterLoopAttribute

```cs
[OuterLoop()]
[OuterLoop]
```
Tests marked as `OuterLoop` are for scenarios that don't need to run every build. They may take longer than normal tests, cover seldom hit code paths, or require special setup or resources to execute. These tests are excluded by default when testing through `dotnet build` but can be enabled manually by adding the `-testscope outerloop` switch or `/p:TestScope=outerloop` e.g.
Tests marked as `OuterLoop` are for scenarios that don't need to run every build. They may take longer than normal tests, cover seldom hit code paths, or require special setup or resources to execute. These tests are excluded by default when testing through `dotnet test` but can be enabled manually by adding the `-testscope outerloop` switch or `/p:TestScope=outerloop` e.g.

```cmd
build -test -testscope outerloop
cd src/System.Text.RegularExpressions/tests && dotnet build /t:Test /p:TestScope=outerloop
dotnet test src/System.Text.RegularExpressions/tests /p:TestScope=outerloop
```

#### PlatformSpecificAttribute
Expand All @@ -22,17 +22,13 @@ cd src/System.Text.RegularExpressions/tests && dotnet build /t:Test /p:TestScope
Use this attribute on test methods to specify that this test may only be run on the specified platforms. This attribute returns the following categories based on platform
- `nonwindowstests` for tests that don't run on Windows
- `nonlinuxtests` for tests that don't run on Linux
- `nonosxtests` for tests that don't run on OS X
- `nonosxtests` for tests that don't run on macOS

**[Available Test Platforms](https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.XUnitExtensions/src/TestPlatforms.cs)**

When running tests by building a test project, tests that don't apply to the `TargetOS` are not run. For example, to run Linux-specific tests on a Linux box, use the following command line:
```sh
dotnet build <csproj_file> /t:Test /p:TargetOS=Linux
```
To run all Linux-compatible tests that are failing:
```sh
dotnet build <csproj_file> /t:Test /p:TargetOS=Linux /p:WithCategories=failing
dotnet test <csproj_file> /p:TargetOS=Linux
```

#### ActiveIssueAttribute
Expand Down Expand Up @@ -148,9 +144,11 @@ _**A few common examples with the above attributes:**_

- Run all tests acceptable on Windows that are not failing:
```cmd
dotnet build <csproj_file> /t:Test /p:TargetOS=Windows_NT
dotnet test <csproj_file> /p:TargetOS=Windows_NT
```
- Run all outer loop tests acceptable on OS X that are currently associated with active issues:
```sh
dotnet build <csproj_file> /t:Test /p:TargetOS=OSX /p:WithCategories="OuterLoop;failing""
dotnet test <csproj_file> /p:TargetOS=OSX /p:WithCategories="OuterLoop;failing""
```

Note: The `TargetOS` property can usually be omitted as it defaults to the OS.
2 changes: 1 addition & 1 deletion docs/workflow/testing/libraries/testing-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Make sure an emulator is booted (see `AVD Manager`) or a device is plugged in an
### Running individual test suites
The following shows how to run tests for a specific library
```
./dotnet.sh build /t:Test src/libraries/System.Numerics.Vectors/tests /p:TargetOS=Android /p:TargetArchitecture=x64
./dotnet.sh test src/libraries/System.Numerics.Vectors/tests /p:TargetOS=Android /p:TargetArchitecture=x64
```

### Test App Design
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/testing/libraries/testing-apple.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In order to run the tests on a device you need to specify `DevTeamProvisioning`
### Running individual test suites
- The following shows how to run tests for a specific library:
```
./dotnet.sh build src/libraries/System.Numerics.Vectors/tests /t:Test /p:TargetOS=iOS /p:TargetArchitecture=x64
./dotnet.sh test src/libraries/System.Numerics.Vectors/tests /p:TargetOS=iOS /p:TargetArchitecture=x64
```

### Test App Design
Expand Down
4 changes: 2 additions & 2 deletions docs/workflow/testing/libraries/testing-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ and even run tests one by one for each library:
### Running individual test suites
The following shows how to run tests for a specific library
```
./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release
./dotnet.sh test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm -c Release
```

### Running tests using different JavaScript engines
It's possible to set a JavaScript engine explicitly by adding `/p:JSEngine` property:

```
./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:JSEngine=SpiderMonkey
./dotnet.sh test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm -c Release /p:JSEngine=SpiderMonkey
```

At the moment supported values are:
Expand Down
36 changes: 20 additions & 16 deletions docs/workflow/testing/libraries/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,63 @@ To build the tests and run them you can call the libraries build script.
**Examples**
- The following shows how to build only the tests but not run them:
```
build.cmd/sh -subset libs.tests
build.cmd/sh libs.tests
```

- The following builds and runs all tests in release configuration:
```
build.cmd/sh -subset libs.tests -test -c Release
build.cmd/sh libs.tests -test -c Release
```

- The following example shows how to pass extra msbuild properties to ignore tests ignored in CI:
```
build.cmd/sh -subset libs.tests -test /p:WithoutCategories=IgnoreForCI
build.cmd/sh libs.tests -test /p:WithoutCategories=IgnoreForCI
```

Unless you specifiy `-testnobuild`, test assemblies are implicitly built when invoking the `Test` action.
- The following shows how to only test the libraries without building them
```
build.cmd/sh -subset libs.tests -test -testnobuild
build.cmd/sh -test -testnobuild
```

## Running tests on the command line

To build tests you need to specify the `test` subset when invoking build.cmd/sh: `build.cmd/sh -subset libs.tests`.
To build tests you need to specify the `libs.tests` subset when invoking build.cmd/sh: `build.cmd/sh libs.tests`.

The easiest (and recommended) way to build and run the tests for a specific library, is to invoke the `Test` target on that library:
The easiest (and recommended) way to build and run the tests for a specific library, is to invoke `dotnet test` on that library:
```cmd
cd src\libraries\System.Collections.Immutable\tests
dotnet build /t:Test
dotnet test src\libraries\System.Collections.Immutable\tests
```

It is possible to pass parameters to the underlying xunit runner via the `XUnitOptions` parameter, e.g.:
It is possible to pass parameters to the underlying VSTest runner, e.g.:
```cmd
dotnet build /t:Test /p:XUnitOptions="-class Test.ClassUnderTests"
dotnet test --filter Test.ClassUnderTests
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
```

The available arguments for `dotnet test` are documented [here](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test) and advanced filtering options can be found [here](https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=xunit).

There may be multiple projects in some directories so you may need to specify the path to a specific test project to get it to build and run the tests.

#### Running a single test on the command line

To quickly run or debug a single test from the command line, set the XunitMethodName property, e.g.:
To quickly run or debug a single test from the command line, supply a filter argument value, e.g.:
```cmd
dotnet build /t:Test /p:XunitMethodName={FullyQualifiedNamespace}.{ClassName}.{MethodName}
dotnet test --filter {FullyQualifiedNamespace}.{ClassName}.{MethodName}
```

#### Running outer loop tests

To run all tests, including "outer loop" tests (which are typically slower and in some test suites less reliable, but which are more comprehensive):
```cmd
dotnet build /t:Test /p:Outerloop=true
dotnet test /p:Outerloop=true
```

#### Running tests on a different target framework
#### Running tests on a single target framework

Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. By default we will build and run only the default build target framework which is `net5.0`. The rest of the `TargetFrameworks` will need to be built and ran by specifying the `BuildTargetFramework` option, e.g.:
Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. To run against a single target framework you can specify the `TargetFramework` via the framework `-f` switch:
```cmd
dotnet build src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj /p:BuildTargetFramework=net472
dotnet test -f net48 src\libraries\System.Text.RegularExpressions\tests
```

#### Using an alternative test runner (advanced)
For non mobile configurations, the default test runner is VSTest (locally and in CI). By passing in `/p:TestRunner=xunit` when invoking `dotnet test`, an alternative test runner `xunit.console` is used. Even though that test runner is out-of-support and deprecated, it is still useful when debugging runtime issues or when adding support for new operating systems or devices. Our plan is to eventually get rid of `xunit.console` by adding a lightweight mode to the VSTest runner.
2 changes: 1 addition & 1 deletion docs/workflow/testing/mono/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ build.cmd /p:RuntimeFlavor=mono
3. Run the tests

```
dotnet build /t:Test /p:RuntimeFlavor=mono
dotnet test /p:RuntimeFlavor=mono
```

# Patching Local dotnet (.dotnet-mono)
Expand Down
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+libs.tests+'))">
<ProjectToBuild Include="$(LibrariesProjectRoot)tests.proj" Category="libs" Test="true" />
<ProjectToBuild Include="$(LibrariesProjectRoot)tests.proj" Category="libs" Test="true" Publish="true" />
</ItemGroup>

<!-- Installer sets -->
Expand Down
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
<Sha>f69d7fc09c4fdb9e9427741b9a176e867dab577f</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.8.0-release-20201009-01">
<Uri>https://github.com/microsoft/vstest</Uri>
<Sha>2418d9ec492e93245e1ce8699d6ae9cd7b86649b</Sha>
</Dependency>
<Dependency Name="Microsoft.TestPlatform.CLI" Version="16.8.0-release-20201009-01">
<Uri>https://github.com/microsoft/vstest</Uri>
<Sha>0b1e2e51743cc083d99b88673fe518672e2af9f0</Sha>
</Dependency>
Expand Down
4 changes: 3 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
<MicrosoftBclAsyncInterfacesVersion>1.1.1</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
<runtimenativeSystemIOPortsVersion>5.0.0-alpha.1.19563.3</runtimenativeSystemIOPortsVersion>
<!-- VSTest dependencies -->
<MicrosoftNETTestSdkVersion>16.8.0-release-20201009-01</MicrosoftNETTestSdkVersion>
<MicrosoftTestPlatformCLIVersion>16.8.0-release-20201009-01</MicrosoftTestPlatformCLIVersion>
<!-- Runtime-Assets dependencies -->
<SystemComponentModelTypeConverterTestDataVersion>5.0.0-beta.20505.2</SystemComponentModelTypeConverterTestDataVersion>
<SystemDrawingCommonTestDataVersion>5.0.0-beta.20505.2</SystemDrawingCommonTestDataVersion>
Expand Down Expand Up @@ -136,7 +139,6 @@
<RefOnlyNugetProjectModelVersion>4.9.4</RefOnlyNugetProjectModelVersion>
<RefOnlyNugetPackagingVersion>4.9.4</RefOnlyNugetPackagingVersion>
<!-- Testing -->
<MicrosoftNETTestSdkVersion>16.8.0-release-20201009-01</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.20516.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.20516.1</MicrosoftDotNetXHarnessCLIVersion>
<XUnitVersion>2.4.1</XUnitVersion>
Expand Down
1 change: 1 addition & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ foreach ($argument in $PSBoundParameters.Keys)
"framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
"os" { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" }
"allconfigurations" { $arguments += " /p:BuildAllConfigurations=true" }
"coverage" { $arguments += " /p:VSTestCollect='XPlat Code Coverage'" }
"properties" { $arguments += " " + $properties }
"verbosity" { $arguments += " -$argument " + $($PSBoundParameters[$argument]) }
# configuration and arch can be specified multiple times, so they should be no-ops here
Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ while [[ $# > 0 ]]; do
;;

-coverage)
arguments="$arguments /p:Coverage=true"
arguments="$arguments /p:VSTestCollect='XPlat Code Coverage'"
shift 1
;;

Expand Down
17 changes: 17 additions & 0 deletions eng/pipelines/common/templates/innerloop-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parameters:
buildConfig: ''
archType: ''
testLibrary: ''
testRunner: ''
condition: always()

steps:
# Build and test leaf solution
- ${{ if ne(parameters.testLibrary, '') }}:
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
- script: dotnet test
$(Build.SourcesDirectory)/src/libraries/${{ parameters.testLibrary }}/
-c ${{ parameters.buildConfig }}
/p:TargetArchitecture=${{ parameters.archType }}
/p:TestRunner=${{ parameters.testRunner }}
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/innerloop-steps-test.binlog
displayName: Build and test leaf solution
5 changes: 5 additions & 0 deletions eng/pipelines/global-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ jobs:
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
timeoutInMinutes: 90
platforms:
- Windows_NT_x86
- OSX_x64
jobParameters:
testGroup: innerloop
nameSuffix: Runtime_Debug
buildArgs: -c release -runtimeConfiguration debug
extraStepsTemplate: /eng/pipelines/common/templates/innerloop-steps.yml
extraStepsParameters:
testLibrary: System.AppContext
testRunner: xunit

#
# Build with Debug config and Release runtimeConfiguration
Expand Down
Loading