Lefteris
Lefteris

Reputation: 885

mvn package executes more tests locally that in bamboo

I have a spring-boot application which includes JUnit tests and I build using maven. I have organized by JUnit tests in a Suite using @Suite.SuiteClasses notation.

My problem/question is why when I run mvn package locally, I see that the unit tests referenced by the Suite are executed but they are also executed as if they were not part of the suite, while building the code in Bamboo, using again mvn package executes the tests only once (i.e. as members of the suite).

Upvotes: 1

Views: 296

Answers (1)

wemu
wemu

Reputation: 8160

Do you use the same profiles / settings / maven commands on bamboo and locally?

I think what happens is that when executing the package phase the surefire-plugin starts executing all the tests. There might be a naming issue with the includes the surefire plugin uses by default.

If you execute the maven goal with -X you should be able to see the surefire-plugin configuration it uses to identify the tests. This should only match your suites - not the suites and the tests themselves.

Upvotes: 1

Related Questions