Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into support-cucontextconf…
Browse files Browse the repository at this point in the history
…-as-meta-annotation
  • Loading branch information
mpkorstanje committed Nov 1, 2022
2 parents 6461925 + aa05551 commit 4636803
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- [Core] Don't swallow parse errors on the CLI ([2632](https://github.com/cucumber/cucumber-jvm/issues/2632) M.P. Korstanje)

### Added
- [Spring] Support @CucumberContextConfiguration as a meta-annotation ([2491](https://github.com/cucumber/cucumber-jvm/issues/2491) Michael Schlatt)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion cucumber-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<xmlunit.version>2.9.0</xmlunit.version>
<hamcrest.version>2.2</hamcrest.version>
<hamcrest-json.version>0.2</hamcrest-json.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
<vertx.version>4.3.4</vertx.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ public static Builder builder() {
}

public void run() {
// Parse the features early. Don't proceed when there are lexer errors
List<Feature> features = featureSupplier.get();
context.startTestRun();
execute(() -> {
context.runBeforeAllHooks();
runFeatures();
runFeatures(features);
});
execute(context::runAfterAllHooks);
execute(context::finishTestRun);
Expand All @@ -98,8 +100,7 @@ private void execute(Runnable runnable) {
}
}

private void runFeatures() {
List<Feature> features = featureSupplier.get();
private void runFeatures(List<Feature> features) {
features.forEach(context::beforeFeature);
List<Future<?>> executingPickles = features.stream()
.flatMap(feature -> feature.getPickles().stream())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.cucumber.core.exception.CompositeCucumberException;
import io.cucumber.core.feature.TestFeatureParser;
import io.cucumber.core.gherkin.Feature;
import io.cucumber.core.gherkin.FeatureParserException;
import io.cucumber.core.options.RuntimeOptionsBuilder;
import io.cucumber.core.runner.StepDurationTimeService;
import io.cucumber.core.runner.TestBackendSupplier;
Expand Down Expand Up @@ -127,6 +128,17 @@ void with_ambiguous_scenarios() {
assertThat(runtime.exitStatus(), is(equalTo((byte) 0x1)));
}

@Test
void with_parse_error() {
Runtime runtime = Runtime.builder()
.withFeatureSupplier(() -> {
throw new FeatureParserException("oops");
})
.build();

assertThrows(FeatureParserException.class, runtime::run);
}

@Test
void should_pass_if_no_features_are_found() {
Runtime runtime = Runtime.builder()
Expand Down
2 changes: 1 addition & 1 deletion cucumber-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<hamcrest.version>2.2</hamcrest.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<project.Automatic-Module-Name>io.cucumber.guice</project.Automatic-Module-Name>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion cucumber-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<hamcrest.version>2.2</hamcrest.version>
<jackson.version>2.13.4.20221013</jackson.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion cucumber-java8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<apiguardian-api.version>1.1.2</apiguardian-api.version>
<hamcrest.version>2.2</hamcrest.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
<typetools.version>0.6.3</typetools.version>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion cucumber-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<hamcrest.version>2.2</hamcrest.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<junit.version>4.13.2</junit.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
<project.Automatic-Module-Name>io.cucumber.junit</project.Automatic-Module-Name>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion cucumber-openejb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<apiguardian-api.version>1.1.2</apiguardian-api.version>
<hamcrest.version>2.2</hamcrest.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<openejb-core.version>8.0.12</openejb-core.version>
<openejb-core.version>8.0.13</openejb-core.version>
<project.Automatic-Module-Name>io.cucumber.openejb</project.Automatic-Module-Name>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion cucumber-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<spring.version>5.3.23</spring.version>
<project.Automatic-Module-Name>io.cucumber.spring</project.Automatic-Module-Name>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion cucumber-testng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<hamcrest.version>2.2</hamcrest.version>
<testng.version>7.6.1</testng.version>
<apiguardian-api.version>1.1.2</apiguardian-api.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion datatable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<hamcrest.version>2.2</hamcrest.version>
<jackson.version>2.13.4.20221013</jackson.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<mockito.version>4.8.0</mockito.version>
<mockito.version>4.8.1</mockito.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.3.4</version>
<version>10.4</version>
</dependency>
</dependencies>
<configuration>
Expand Down
10 changes: 10 additions & 0 deletions release-notes/v7.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,13 @@ should fail a test run.
To make migration graceful the `--strict` and `--non-strict` CLI arguments and
`cucumber.execution.strict` property were left in place. These have now been
removed.


Cucumber-Java8 currently under consideration for deprecation
------------------------------------------------------------

Due to technical difficulties, the `cucumber-java8` module is currently
[under consideration for removal](https://github.com/cucumber/cucumber-jvm/issues/2174).
While [alternatives are explored](https://github.com/cucumber/cucumber-jvm/issues/2279),
you can already [migrate to `cucumber-java` annotation based step definitions automatically](https://github.com/timtebeek/cucumber-jvm-upgrades).
For now [Cucumber-Java8 is removed as recommendation](https://github.com/cucumber/docs/pull/783).

0 comments on commit 4636803

Please sign in to comment.