From 8db80750baebda9216593d52e459a337589f7271 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 20:45:38 +1200 Subject: [PATCH 1/5] Bump the maven-dependencies group with 4 updates (#927) Bumps the maven-dependencies group with 4 updates: [org.junit:junit-bom](https://github.com/junit-team/junit-framework), [com.github.javaparser:javaparser-core](https://github.com/javaparser/javaparser), [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) and [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin). Updates `org.junit:junit-bom` from 5.13.0 to 5.13.2 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.0...r5.13.2) Updates `com.github.javaparser:javaparser-core` from 3.26.4 to 3.27.0 - [Release notes](https://github.com/javaparser/javaparser/releases) - [Changelog](https://github.com/javaparser/javaparser/blob/master/changelog.md) - [Commits](https://github.com/javaparser/javaparser/compare/javaparser-parent-3.26.4...javaparser-parent-3.27.0) Updates `com.puppycrawl.tools:checkstyle` from 10.25.0 to 10.26.1 - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.25.0...checkstyle-10.26.1) Updates `org.sonatype.central:central-publishing-maven-plugin` from 0.7.0 to 0.8.0 - [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.13.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: maven-dependencies - dependency-name: com.github.javaparser:javaparser-core dependency-version: 3.27.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-dependencies - dependency-name: com.puppycrawl.tools:checkstyle dependency-version: 10.26.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-dependencies - dependency-name: org.sonatype.central:central-publishing-maven-plugin dependency-version: 0.8.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: serhatozdursun --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 86c0175e..92fd2223 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.junit junit-bom - 5.13.0 + 5.13.2 pom import @@ -46,7 +46,7 @@ com.github.javaparser javaparser-core - 3.26.4 + 3.27.0 org.json @@ -215,7 +215,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central @@ -235,7 +235,7 @@ com.puppycrawl.tools checkstyle - 10.25.0 + 10.26.1 From 51bbf3744bff125f5e1204bf2652ad4021095114 Mon Sep 17 00:00:00 2001 From: serhatozdursun Date: Mon, 21 Jul 2025 17:34:40 +0300 Subject: [PATCH 2/5] fix: short-circuit execution for skipScenario in StepExecutionStage and HookExecutionStage; add corresponding tests Signed-off-by: serhatozdursun --- .../gauge/execution/HookExecutionStage.java | 3 +++ .../gauge/execution/StepExecutionStage.java | 2 +- .../gauge/execution/HookExecutionStageTest.java | 16 ++++++++++++++++ .../gauge/execution/StepExecutionStageTest.java | 14 ++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java diff --git a/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java b/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java index e3599552..60c2aff8 100644 --- a/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java +++ b/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java @@ -28,6 +28,9 @@ public void setNextStage(ExecutionStage stage) { } public Spec.ProtoExecutionResult execute(Spec.ProtoExecutionResult result) { + if (result.getFailed() || result.getSkipScenario()) { + return executeNext(result); + } Spec.ProtoExecutionResult execResult = execute(); Spec.ProtoExecutionResult stageResult = mergeExecResults(result, execResult); return executeNext(stageResult); diff --git a/src/main/java/com/thoughtworks/gauge/execution/StepExecutionStage.java b/src/main/java/com/thoughtworks/gauge/execution/StepExecutionStage.java index 32b693f7..39f05164 100644 --- a/src/main/java/com/thoughtworks/gauge/execution/StepExecutionStage.java +++ b/src/main/java/com/thoughtworks/gauge/execution/StepExecutionStage.java @@ -35,7 +35,7 @@ public void setNextStage(ExecutionStage stage) { } public Spec.ProtoExecutionResult execute(Spec.ProtoExecutionResult previousStageResult) { - if (previousStageResult.getFailed()) { + if (previousStageResult.getFailed() || previousStageResult.getSkipScenario()) { return executeNext(previousStageResult); } Spec.ProtoExecutionResult stageResult = executeStep(); diff --git a/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java b/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java new file mode 100644 index 00000000..554e4ac8 --- /dev/null +++ b/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java @@ -0,0 +1,16 @@ +package com.thoughtworks.gauge.execution; + +import gauge.messages.Spec; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class HookExecutionStageTest { + @Test + public void shouldShortCircuitIfPreviousStageSkipped() { + HookExecutionStage stage = new HookExecutionStage(java.util.Collections.emptyList(), new com.thoughtworks.gauge.ClassInstanceManager()); + Spec.ProtoExecutionResult previous = Spec.ProtoExecutionResult.newBuilder().setSkipScenario(true).build(); + Spec.ProtoExecutionResult result = stage.execute(previous); + assertTrue(result.getSkipScenario()); + } +} \ No newline at end of file diff --git a/src/test/java/com/thoughtworks/gauge/execution/StepExecutionStageTest.java b/src/test/java/com/thoughtworks/gauge/execution/StepExecutionStageTest.java index 67199c6c..de2da117 100644 --- a/src/test/java/com/thoughtworks/gauge/execution/StepExecutionStageTest.java +++ b/src/test/java/com/thoughtworks/gauge/execution/StepExecutionStageTest.java @@ -251,4 +251,18 @@ public Object table(Object table) { public void skipScenarioStep() { throw new com.thoughtworks.gauge.SkipScenarioException("skipping this scenario due to unmet condition"); } + + @Test + public void shouldShortCircuitIfPreviousStageSkipped() { + Messages.ExecuteStepRequest executeStepRequest = Messages.ExecuteStepRequest.newBuilder() + .setParsedStepText("foo bar") + .setActualStepText("foo bar") + .build(); + StepExecutionStage executionStage = new StepExecutionStage( + executeStepRequest, new ClassInstanceManager(), new ParameterParsingChain(), mock(StepRegistry.class) + ); + Spec.ProtoExecutionResult previous = Spec.ProtoExecutionResult.newBuilder().setSkipScenario(true).build(); + Spec.ProtoExecutionResult result = executionStage.execute(previous); + assertTrue(result.getSkipScenario()); + } } From 4e346fadd2f7c0037d264a0c8426aec41e064190 Mon Sep 17 00:00:00 2001 From: serhatozdursun Date: Mon, 25 Aug 2025 19:32:25 +0300 Subject: [PATCH 3/5] update hook executor scenario to mark the scenario as skipped if it marked as skipped in before hook Signed-off-by: serhatozdursun --- .../java/com/thoughtworks/gauge/execution/HooksExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/thoughtworks/gauge/execution/HooksExecutor.java b/src/main/java/com/thoughtworks/gauge/execution/HooksExecutor.java index fc24cbb3..b0506434 100644 --- a/src/main/java/com/thoughtworks/gauge/execution/HooksExecutor.java +++ b/src/main/java/com/thoughtworks/gauge/execution/HooksExecutor.java @@ -34,7 +34,7 @@ public Spec.ProtoExecutionResult execute() { for (Hook hook : hooks) { result = new TaggedHookExecutor(hook, info).execute(); totalHooksExecutionTime += result.getExecutionTime(); - if (result.getFailed()) { + if (result.getFailed() || result.getSkipScenario()) { return Spec.ProtoExecutionResult.newBuilder(result).setExecutionTime(totalHooksExecutionTime).build(); } } From 804bd2356ff80b2563dfa27da220cbfe2f7ef1c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 12:53:12 +0800 Subject: [PATCH 4/5] Bump the maven-dependencies group with 3 updates (#929) Bumps the maven-dependencies group with 3 updates: [io.grpc:grpc-bom](https://github.com/grpc/grpc-java), [org.junit:junit-bom](https://github.com/junit-team/junit-framework) and [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin). Updates `io.grpc:grpc-bom` from 1.73.0 to 1.74.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.73.0...v1.74.0) Updates `org.junit:junit-bom` from 5.13.2 to 5.13.4 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.2...r5.13.4) Updates `org.apache.maven.plugins:maven-gpg-plugin` from 3.2.7 to 3.2.8 - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.7...maven-gpg-plugin-3.2.8) --- updated-dependencies: - dependency-name: io.grpc:grpc-bom dependency-version: 1.74.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-dependencies - dependency-name: org.junit:junit-bom dependency-version: 5.13.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: maven-dependencies - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-version: 3.2.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: maven-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: serhatozdursun --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 92fd2223..cd886b59 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.junit junit-bom - 5.13.2 + 5.13.4 pom import @@ -195,7 +195,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.7 + 3.2.8 sign-artifacts @@ -317,7 +317,7 @@ ${java.version} 4.31.1 - 1.73.0 + 1.74.0 From 82174bf019dedcd431037902514464049600954c Mon Sep 17 00:00:00 2001 From: serhatozdursun Date: Fri, 22 May 2026 12:09:39 +0300 Subject: [PATCH 5/5] refactor: remove unnecessary skip short-circuit from HookExecutionStage; add HooksExecutor skip test Signed-off-by: serhatozdursun --- .../gauge/execution/HookExecutionStage.java | 3 --- .../execution/HookExecutionStageTest.java | 16 ------------- .../gauge/execution/HooksExecutorTest.java | 23 +++++++++++++++++++ 3 files changed, 23 insertions(+), 19 deletions(-) delete mode 100644 src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java diff --git a/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java b/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java index 60c2aff8..e3599552 100644 --- a/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java +++ b/src/main/java/com/thoughtworks/gauge/execution/HookExecutionStage.java @@ -28,9 +28,6 @@ public void setNextStage(ExecutionStage stage) { } public Spec.ProtoExecutionResult execute(Spec.ProtoExecutionResult result) { - if (result.getFailed() || result.getSkipScenario()) { - return executeNext(result); - } Spec.ProtoExecutionResult execResult = execute(); Spec.ProtoExecutionResult stageResult = mergeExecResults(result, execResult); return executeNext(stageResult); diff --git a/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java b/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java deleted file mode 100644 index 554e4ac8..00000000 --- a/src/test/java/com/thoughtworks/gauge/execution/HookExecutionStageTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.thoughtworks.gauge.execution; - -import gauge.messages.Spec; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class HookExecutionStageTest { - @Test - public void shouldShortCircuitIfPreviousStageSkipped() { - HookExecutionStage stage = new HookExecutionStage(java.util.Collections.emptyList(), new com.thoughtworks.gauge.ClassInstanceManager()); - Spec.ProtoExecutionResult previous = Spec.ProtoExecutionResult.newBuilder().setSkipScenario(true).build(); - Spec.ProtoExecutionResult result = stage.execute(previous); - assertTrue(result.getSkipScenario()); - } -} \ No newline at end of file diff --git a/src/test/java/com/thoughtworks/gauge/execution/HooksExecutorTest.java b/src/test/java/com/thoughtworks/gauge/execution/HooksExecutorTest.java index 54c2cc39..bd096131 100644 --- a/src/test/java/com/thoughtworks/gauge/execution/HooksExecutorTest.java +++ b/src/test/java/com/thoughtworks/gauge/execution/HooksExecutorTest.java @@ -8,14 +8,18 @@ import com.thoughtworks.gauge.BeforeScenario; import com.thoughtworks.gauge.ClassInstanceManager; import com.thoughtworks.gauge.ContinueOnFailure; +import com.thoughtworks.gauge.ExecutionContext; import com.thoughtworks.gauge.Operator; +import com.thoughtworks.gauge.SkipScenarioException; import com.thoughtworks.gauge.hook.Hook; import gauge.messages.Spec; import org.junit.jupiter.api.Test; import java.util.ArrayList; +import java.util.List; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class HooksExecutorTest { @@ -30,6 +34,25 @@ public void testHookExecutor() throws Exception { assertFalse(result.getRecoverableError()); } + @Test + public void shouldShortCircuitOnSkipScenario() throws Exception { + Hook skipHook = new Hook(HooksExecutorTest.class.getMethod("hookThatSkips"), new String[0], Operator.AND); + Hook shouldNotRunHook = new Hook(HooksExecutorTest.class.getMethod("hookThatFails"), new String[0], Operator.AND); + HooksExecutor executor = new HooksExecutor( + List.of(skipHook, shouldNotRunHook), new ExecutionContext(), new ClassInstanceManager()); + Spec.ProtoExecutionResult result = executor.execute(); + assertTrue(result.getSkipScenario()); + assertFalse(result.getFailed()); + } + + public void hookThatSkips() { + throw new SkipScenarioException("skip this scenario"); + } + + public void hookThatFails() { + throw new RuntimeException("second hook must not run after skip"); + } + private static class TestHook { @ContinueOnFailure @BeforeScenario