mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 10:18:21 +09:00
Clarify host testing instructions (#49797)
This commit is contained in:
parent
fa7e11c910
commit
a4c89d6b52
1 changed files with 9 additions and 7 deletions
|
@ -6,10 +6,12 @@ The [host tests](/src/installer/tests) use [xunit](http://xunit.github.io/) for
|
|||
|
||||
To build the host tests, first build the product:
|
||||
|
||||
1. Build CoreCLR and libraries:
|
||||
|
||||
* [CoreCLR](../../building/coreclr/README.md)
|
||||
* [Libraries](../../building/libraries/README.md)
|
||||
1. Build CoreCLR and libraries (`clr` and `libs` subsets):
|
||||
```
|
||||
build.cmd/sh -subset clr+libs -c Release
|
||||
```
|
||||
* [CoreCLR](../../building/coreclr/README.md) build instructions
|
||||
* [Libraries](../../building/libraries/README.md) build instructions
|
||||
|
||||
2. Build the host and packs:
|
||||
```
|
||||
|
@ -58,6 +60,8 @@ By default, the above command will also build the tests before running them. To
|
|||
|
||||
### Running specific tests
|
||||
|
||||
If all tests have not been previously run, make sure the [test context](#test-context) is set up for the test library.
|
||||
|
||||
Tests from a specific test project can be run using [`dotnet test`](https://docs.microsoft.com/dotnet/core/tools/dotnet-test) targeting the built test binary. For example:
|
||||
```
|
||||
dotnet test artifacts/bin/HostActivation.Tests/Debug/net5.0/HostActivation.Tests.dll
|
||||
|
@ -68,12 +72,10 @@ To filter to specific tests within the test library, use the [filter options](ht
|
|||
dotnet test artifacts/bin/HostActivation.Tests/Debug/net5.0/HostActivation.Tests.dll --filter DependencyResolution
|
||||
```
|
||||
|
||||
If all tests have not been previously run, make sure the [test context](#test-context) is set up for the test library.
|
||||
|
||||
### Visual Studio
|
||||
|
||||
The [Microsoft.DotNet.CoreSetup.sln](/src/installer/Microsoft.DotNet.CoreSetup.sln) can be used to run and debug host tests through Visual Studio. When using the solution, the product should have already been [built](#building-tests) and the [test context](#test-context) set up.
|
||||
|
||||
### Preserving test artifacts
|
||||
|
||||
In order to test the hosting components, the tests launch a separate process (e.g. `dotnet`, apphost, native host) and validate the expected output (standard output and error) of the launched process. This usually involves copying or creating test artifacts in the form of an application to run or a .NET install to run against. The tests will delete these artifacts after the test finishes. To allow inspection or usage after the test finishes, set the environment variable `PRESERVE_TEST_RUNS=1` to avoid deleting the test artifacts.
|
||||
In order to test the hosting components, the tests launch a separate process (e.g. `dotnet`, apphost, native host) and validate the expected output (standard output and error) of the launched process. This usually involves copying or creating test artifacts in the form of an application to run or a .NET install to run against. The tests will delete these artifacts after the test finishes. To allow inspection or usage after the test finishes, set the environment variable `PRESERVE_TEST_RUNS=1` to avoid deleting the test artifacts.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue