-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Describe the bug
Previously this was working well for me - a single failed scenario would be re-generated next time and the executed.
A recent upgrade from 1.14.1 to 1.15.1 caused all scenarios in the feature with a failure to be generated
To Reproduce
Steps to reproduce the behavior:
- Run cucuable pointing at a "re-run" folder with a file that identifies a specific source scenario.
filename: /tmp/reruns/rerun1.txt
Contents:
file:///path/xyz.feature:4
- Run Cucable by passing the rerun folder into the sourceFeatures property
-Dparallel.sourceFeatures=@/tmp/reruns/
- Cucable generates a runner and feature for each scenario contained in the feature.
Expected behavior
Cucable will generate one runner and one feature as only one scenario was activated in the input.
Attachments
If applicable, add an attachment to help explain your problem.
Additional context
I believe this functionality got lost in a recent change: d83a32b
Based off the old code, I provide the attached patch that seems to fix the issue locally for me.
diff --git a/plugin-code/src/main/java/com/trivago/gherkin/GherkinDocumentParser.java b/plugin-code/src/main/java/com/trivago/gherkin/GherkinDocumentParser.java
index 5936cdc..907d7b1 100644
--- a/plugin-code/src/main/java/com/trivago/gherkin/GherkinDocumentParser.java
+++ b/plugin-code/src/main/java/com/trivago/gherkin/GherkinDocumentParser.java
@@ -150,7 +150,13 @@ public class GherkinDocumentParser {
lineNumber = originalScenario.getLocation().getLine().intValue();
}
}
-
+
+ if (scenarioLineNumbers != null
+ && !scenarioLineNumbers.isEmpty()
+ && !scenarioLineNumbers.contains(lineNumber)) {
+ continue;
+ }
+
// Check if this is a scenario outline (has examples)
boolean isScenarioOutline = originalScenario != null &&
originalScenario.getExamples() != null &&
Metadata
Metadata
Assignees
Labels
No labels