Skipping tests in pipeline build step (#1358)

* Adding special argument for running tests in cake file to skip it during pipeline runs

* documenting new build param in cake file
This commit is contained in:
Aasim Khan
2022-01-11 10:31:40 -08:00
committed by GitHub
parent 0fcc6dc5cf
commit 65cb83a843
2 changed files with 5 additions and 0 deletions

View File

@@ -48,6 +48,8 @@ The build script itself is `build.cake`, written in Cake's C#-like DSL using the
`-archive`: Enable the generation of publishable archives after a build.
`-runTests`: Enable running of tests in the cake file. By default, the tests are skipped.
## Targets
**Default**: Alias for Local.

View File

@@ -279,6 +279,7 @@ Task("DotnetPackPublished")
Task("TestAll")
.IsDependentOn("Test")
.IsDependentOn("TestCore")
.WithCriteria(c => HasArgument("runTests"))
.Does(() =>{});
/// <summary>
@@ -287,6 +288,7 @@ Task("TestAll")
Task("TestCore")
.IsDependentOn("Setup")
.IsDependentOn("Restore")
.WithCriteria(c => HasArgument("runTests"))
.Does(() =>
{
var testProjects = buildPlan.TestProjects
@@ -311,6 +313,7 @@ Task("Test")
.IsDependentOn("SRGen")
.IsDependentOn("CodeGen")
.IsDependentOn("BuildTest")
.WithCriteria(c => HasArgument("runTests"))
.Does(() =>
{
foreach (var pair in buildPlan.TestProjects)