Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Glacio and Cucumber in the same project #2

Closed
bessonm opened this issue Mar 19, 2019 · 2 comments
Closed

Cannot run Glacio and Cucumber in the same project #2

bessonm opened this issue Mar 19, 2019 · 2 comments

Comments

@bessonm
Copy link
Member

bessonm commented Mar 19, 2019

Hello Loic,

While trying to toy around Glacio, I wanted to compare and run Cucumber tests and Glacio tests in the same project but didn't succeed to do it.

Base on this example project, I removed every thing :

And made 2 commits :

  • One running Glacio tests with 'mvn clean test', using maven-surefire-plugin build :
  • Another running Cucumber tests with 'mvn clean test', without using maven-surefire-plugin build :

Can you help me on this ?
Since I'm not used to junit test engines, what am I missing ?

Thank you very much :)

@ledoyen
Copy link
Contributor

ledoyen commented Mar 19, 2019

Thanks for the feedback early-tester 😄

It seems that you removed too much.

Currently the project you provided uses an old version of the maven-surefire-plugin (2.12.4 by default), only compatible with JUnit4.

In this configuration, only Cucumber can run as JUnit4 cannot run the Glacio engine, built for JUnit-Platform (platform appearing with JUnit5).

To solve your issue, I would :

  • upgrade to the latest version of maven-surefire-plugin which (from version 2.21 if I recall correctly) launches platform-engines instead of using the Junit4 provider
  • add junit-vintage-engine in the dependencies, which is the platform-engine running JUnit4 tests (that is to keep Cucumber tests running)

A word of caution however: as junit-platform is evolving quickly, they may be some breaking changes, In order to work properly, I would keep the same version of the platform used by Glacio for now so, adding to your pom.xml:

    <dependencies>
        ...
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.3.2</version> <!-- not 5.4.1, which will not be able to run Glacio engine (still using 5.3.2) -->
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

should do the trick

@bessonm
Copy link
Member Author

bessonm commented Mar 19, 2019

Perfect !
Indeed, downgrading junit vintage from 5.4.0 to 5.3.2 was the missing piece to run Cucumber !

Thanks ;)

@bessonm bessonm closed this as completed Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants