Skip to content

Commit

Permalink
fix(execution): exclusion of invoked targets from skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Dec 15, 2023
1 parent b77724a commit 8293a9b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
25 changes: 23 additions & 2 deletions source/Nuke.Build.Tests/BuildExecutorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public void TestParameterSkipped_AllWithInvoked()
{
C.Invoked = true;
ExecuteBuild(skippedTargets: new ExecutableTarget[0]);
AssertSucceeded(C);
AssertSkipped(A, B);
AssertSucceeded();
AssertSkipped(A, B, C);
}

[Fact]
Expand Down Expand Up @@ -108,6 +108,27 @@ public void TestStaticCondition_DependencyBehavior_Skip()
B.OnlyWhen.Should().Be("false");
}

[Fact]
public void TestStaticCondition_Invoked_DependencyBehavior_Skip()
{
C.StaticConditions.Add(("() => false", () => false));
C.DependencyBehavior = DependencyBehavior.Skip;
C.Invoked = true;
ExecuteBuild();
AssertSkipped(A, B, C);
}

[Fact]
public void TestStaticCondition_Invoked_DependencyBehavior_Execute()
{
C.StaticConditions.Add(("() => false", () => false));
C.DependencyBehavior = DependencyBehavior.Execute;
C.Invoked = true;
ExecuteBuild();
AssertSkipped(C);
AssertSucceeded(A, B);
}

[Fact]
public void TestStaticCondition_Multiple()
{
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Build/Execution/BuildExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ string Format(string condition)

private static void MarkTargetSkipped(INukeBuild build, ExecutableTarget target, string reason = null)
{
if (target.Invoked || target.Status != ExecutionStatus.Scheduled)
if (target.Status != ExecutionStatus.Scheduled)
return;

target.Status = ExecutionStatus.Skipped;
Expand Down

0 comments on commit 8293a9b

Please sign in to comment.