From 65cb83a8436294050f85a7e4919e8609989cd85a Mon Sep 17 00:00:00 2001 From: Aasim Khan Date: Tue, 11 Jan 2022 10:31:40 -0800 Subject: [PATCH] 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 --- BUILD.md | 2 ++ build.cake | 3 +++ 2 files changed, 5 insertions(+) diff --git a/BUILD.md b/BUILD.md index ee62a397..43328e0d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -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. diff --git a/build.cake b/build.cake index f61b65f9..e7da44ad 100644 --- a/build.cake +++ b/build.cake @@ -279,6 +279,7 @@ Task("DotnetPackPublished") Task("TestAll") .IsDependentOn("Test") .IsDependentOn("TestCore") + .WithCriteria(c => HasArgument("runTests")) .Does(() =>{}); /// @@ -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)