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

Shouldn't maven-surefire-plugin be maven-failsafe-plugin #32

Open
agoncal opened this issue Jun 11, 2014 · 2 comments
Open

Shouldn't maven-surefire-plugin be maven-failsafe-plugin #32

agoncal opened this issue Jun 11, 2014 · 2 comments
Labels

Comments

@agoncal
Copy link

agoncal commented Jun 11, 2014

When we create an Arquillian test with the Forge addon, each profile ends up using the maven-surefire-plugin :

    <profile>
      <id>arquillian-jbossas-remote-7</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.14.1</version>
            <configuration>
              <systemPropertyVariables>
                <arquillian.launch>arquillian-jbossas-remote-7</arquillian.launch>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-remote</artifactId>
          <version>7.2.0.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

Shouldn't it be using the maven-failsafe-plugin ? It's the same old story between unit test and integration test but the Maven phase is different : mvn test with surefire and mvn integration-test with failsafe.

I usually use Arquillian with failsafe so I have my unit tests in one side, and my integration tests in another one (integration test classes finish with IT, example BookServiceIT). Also remember that maybe one day, Forge will have an junit-create-test command. It would be good to have junit-create-test and arquillian-create-test doing things separate (unit test vs integration tests).

What do you think ?

@aslakknutsen
Copy link
Member

failsafe has a very specific use case; start and stop things before after the surefire execution and delay fail until stop has been called.

Arquillian doesn't need that behavior, as it start/stops things within the surefire lifecycle just fine.

If anything, we could bind a surefire addon to the integration-phase in Maven, but.. that kills mvn test

@agoncal
Copy link
Author

agoncal commented Jun 11, 2014

I hope one day Forge will have JUnit commands (junit-setup, junit-create-test, ...) and I would expect these ones to be in the test phase. As for Arquillian tests, it would be good if they were in a different phase (I like the idea of surefire with an integration phase) as well as a different naming convention to differentiate them (eg. BookServiceTest for a unit test, and BookServiceIT for an integration test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants