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

NullPointerException is thrown when having custom surefire configuration #83

Closed
lordofthejars opened this Issue Aug 3, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@lordofthejars
Member

lordofthejars commented Aug 3, 2017

Issue Overview

NullPointerException is thrown when having custom surefire configuration. For example:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.19.1</version>
  <configuration>
    <forkCount>1</forkCount>
    <reuseForks>false</reuseForks>
  </configuration>
</plugin>
Expected Behaviour

Work normally

Current Behaviour

Null pointer exception is thrown.

Steps To Reproduce
  1. Clone https://github.com/perwendel/spark
  2. Install ST extension
  3. mvn -Dsmart.testing=changed -Dsmart.testing.mode=selecting clean test
Additional Information

Using Maven 3.5.0 and Surefire version 2.19.1

@MatousJobanek

This comment has been minimized.

Show comment
Hide comment
@MatousJobanek

MatousJobanek Aug 4, 2017

Contributor

To get the project with this configuration correctly working, you need to use these fixes:
#84
#85
#87
and if you wanted to use the 2.20 version of the surefire plugin, you would need to use also this fix: #86

Contributor

MatousJobanek commented Aug 4, 2017

To get the project with this configuration correctly working, you need to use these fixes:
#84
#85
#87
and if you wanted to use the 2.20 version of the surefire plugin, you would need to use also this fix: #86

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Aug 4, 2017

Member

Great, then let's wait until we merge all of PRs to close it.

Member

lordofthejars commented Aug 4, 2017

Great, then let's wait until we merge all of PRs to close it.

bartoszmajsak added a commit that referenced this issue Aug 4, 2017

fix(#83): moves ordering/selecting of test classes to getSuites method (
#87)

Ordering/selecting of test classes is moved to getSuites method, then when surefire pass the test set to the invoke method it takes that one.

In the case of not reusing forks, surefire calls getSuites and calls the method invoke on new provider instance for each item in the getSuites response

bartoszmajsak added a commit that referenced this issue Aug 4, 2017

fix(#83): extension adds surefire-api dependency to the list of depen…
…dencies (#86)

* fix(surefire 2.20 compatibility): extension adds surefire-api dependency
to the list of deps to override that one used in our provider
otherwise the test that has 2.20 would fail as surefire-api would miss
additional dependencies intoduced in the new version

* it check if the surefire-api dependency is already in the projet's model
specified. If yes, then it doesn't add anything

* changed finding for already existing surefire-api dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment