The test suite will:
- test the current
dotnet new
templates with new packages (to avoid regression) - test some scenarios, using new packages
All tests will copy templates from dotnet new
or test/testAssets
in a temp directory
for each test (so each test is isolated)
The test suiteuse a local package cache (not the global one) in test/packages
.
The package cache is shared by tests, but is cleaned up from this repo packages if the build
script is used (so same package version can be reused for multiple runs).
From repo root, build
will compile, package and run test.
This will cleanup also package cache, and move newly generated nupkg into test/packageToTest
After build
cd test/dotnet-new.Tests
dotnet test
Use env var DOTNET_TEST_PRESERVE_TEMP
to preserve temporary test directories.
Tests are built in temporary directories under %TEMP%\NetcoreCliFscTests
directory
From test/dotnet-new.Tests
:
dotnet test
to run all testsdotnet test -t
to show all tests (without run)dotnet test --filter "FullyQualifiedName=NetcoreCliFsc.Tests.CommonScenario.TestAppWithArgs451"
to run a specific test (see-t
for list)
For projects generated by test suite, the following feed are used
- all feeds in
Nuget.config
test/packageToTest
if exists, recreated byTest
target, contains packages to testtest/externalPackages
if exists
To specify what package version to test, use env var:
TEST_SUITE_FSHARP_NET_SDK_PKG_VERSION
=>FSharp.NET.Sdk
pkg versionTEST_SUITE_FSHARP_CORE_PKG_VERSION
=>FSharp.Core
pkg version
If not set, default versions are specified in test/testAssets/TestSuiteProps/TestSuiteProps.props
Use env var TEST_SUITE_MSBUILD_HOST_TYPES
to run other test for different msbuild host types
Msbuild Core test always run
MSBUILD
to run also MSBuild (.NET Full), requiremsbuild.exe
inPATH
MONO
to run also Mono, requiremono
inPATH
to specify multiple, use ;
separator, so MSBUILD;MONO
for example