Add dotnet cli to runtime test Helix jobs (#35426)
authorSimon Nattress <nattress@gmail.com>
Fri, 15 May 2020 01:39:37 +0000 (18:39 -0700)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 01:39:37 +0000 (18:39 -0700)
commita5b5ec5da8027dbb8acecf0487d8cb250bbace4c
tree89818ea09bc366d79480016e4857ffefb13b6e96
parentadab8f20bb14677e5395e2c6a13c4ecda228adc8
Add dotnet cli to runtime test Helix jobs (#35426)

* Currently managed tools such as crossgen2 and XUnit are run against the built runtime which is slow on Debug builds, and can obscure errors when the XUnit test harness fails due to an introduced runtime bug.
* Add `xunit.console.runtimeconfig.dev.json` which allows `xunit.console` to use the repo-local dotnet.cmd on dev boxes and the same version installed on the path in Helix.
* When running crossgen2 during test execution, support both local dev and Helix scenario when deciding which dotnet to run. On Helix, simply use `dotnet` which assumes a compatible dotnet runtime is in the path. Locally, tests are run with `runtest.cmd|sh` which sets `__TestDotNetCmd` to the repo-local dotnet script. This preserves the characteristic that no machine-wide 5.0 dotnet runtime must be installed for the runtime tests.
* Update batch scripting to also use `dotnet.cmd|sh` when running Crossgen2 replacing corerun.exe.
* crossgen2's `runtimes` folder is not getting copied to `CORE_ROOT` which causes the runtime host to abort the launch on the Unix CI VMs since crossgen.deps.json refers to files in that subfolder. Adjust the `CORE_ROOT` pruning in `Directory.Build.targets` to include subfolders for the two tools that need it.
* Improve XUnit test boilerplate. Printing `Exception.Message` doesn't include stack trace. Use `ToString()` instead.
* Import notargets sdk in `helixpublicwitharcade.proj`. It doesn't use the official sdk so `BundledNETCoreAppPackageVersion` wasn't set. Import the `Microsoft.Build.NoTargets` sdk so we can find the bundled runtime package version.
eng/Versions.props
src/coreclr/build-test.cmd
src/coreclr/build-test.sh
src/coreclr/tests/helixpublishwitharcade.proj
src/coreclr/tests/runtest.py
src/coreclr/tests/src/CLRTest.CrossGen.targets
src/coreclr/tests/src/Common/Directory.Build.targets
src/coreclr/tests/src/runtest.proj