diff --git a/docs/content/configuration.fsx b/docs/content/configuration.fsx index f60b1546..22cac6dd 100644 --- a/docs/content/configuration.fsx +++ b/docs/content/configuration.fsx @@ -111,6 +111,16 @@ wipSleep *) wipSleep <- 1.0 +(** +failIfAnyWipTests +-------- +* Prevents accidentally allowing wip tests into the build pipeline. +* Set to false locally so tests under development are not affected. +* Set to true in your CI environment to catch wip tests that have been mistakenly commited to trunk/master. +* Default is false +*) +failIfAnyWipTests <- true + (** runFailedContextsFirst ----- diff --git a/src/canopy/configuration.fs b/src/canopy/configuration.fs index 717d3f16..fdbc8f13 100644 --- a/src/canopy/configuration.fs +++ b/src/canopy/configuration.fs @@ -48,6 +48,8 @@ let mutable pageTimeout = 10.0 (* documented/configuration *) let mutable wipSleep = 1.0 (* documented/configuration *) +let mutable failIfAnyWipTests = false +(* documented/configuration *) let mutable runFailedContextsFirst = false (* documented/configuration *) let mutable reporter : IReporter = new ConsoleReporter() :> IReporter diff --git a/src/canopy/runner.fs b/src/canopy/runner.fs index cc99c8e2..8e1475fb 100644 --- a/src/canopy/runner.fs +++ b/src/canopy/runner.fs @@ -179,6 +179,12 @@ let private runtest (suite : suite) (test : Test) = (* documented/testing *) let run () = + + let wipsExist = suites |> List.exists (fun s -> s.Wips.IsEmpty = false) + + if wipsExist && configuration.failIfAnyWipTests then + raise <| Exception "Wip tests found and failIfAnyWipTests is true" + reporter.suiteBegin() let stopWatch = new Diagnostics.Stopwatch() stopWatch.Start() @@ -194,7 +200,7 @@ let run () = suites <- fc @ pc //run only wips if there are any - if suites |> List.exists (fun s -> s.Wips.IsEmpty = false) then + if wipsExist then suites <- suites |> List.filter (fun s -> s.Wips.IsEmpty = false || s.Always.IsEmpty = false) suites