Replies: 1 comment
-
This is a workaround, and not exactly what you're looking for, but still a tip of what you can do today. What I've usually used in integration tests to fail fast is the Xunit.Assert package. An example script of that could look something like this: xunit.cake#addin "nuget:?package=xunit.assert&version=2.4.1"
using static Xunit.Assert;
var target = Argument("target", "Default");
Task("MaybeFail")
.Does(()=> Equal("Default", target));
Task("MaybeFail2")
.Does(()=> True(HasArgument("target"), "Target is expected to be specified."));
Task("Default")
.IsDependentOn("MaybeFail")
.IsDependentOn("MaybeFail2");
RunTarget(target); Given Cake launched with
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I propose to create an alias which allows to make build fail without an explicit
throw new exception
after aif
condition.For instance
Fail(bool conditionToFail, string exceptionMessage)
Cake may throw a specific exception in such case and report current task name and line location in cake build file.
Beta Was this translation helpful? Give feedback.
All reactions