Reputation: 4621
Imagine that I have two profiles, one is for production, the other one is for test environment. The thing is, I just want to execute some tests only for development environment, not production.
I tried to put @ignore, but I cannot tell just ignore it ONLY during prod build. I tried to use sure-fire plugin of maven, but again I couldn't get it worked with different behaviour per profile.
(PS: It is a spring-hibernate project featured by such different tech.s like hazelcast, jms (activeMq), scheduler (quartz), else..)
Any help would be appreciated.
Upvotes: 2
Views: 2087
Reputation: 3687
You can ignore junit test using maven.test.skip
parameter as it is described in the documentation. You can also set the parameter as part of as profile.
<profile>
<id>noTest</id>
...
<properties>
<maven.test.skip>true</maven.test.skip>
...
</properties>
...
</profile>
Upvotes: 2
Reputation: 32969
We have a system where we have three test sizes (Small, Medium and Large). We have created an annotation that allows us to mark tests with these sizes. We also created a Rule that will check a particular env variable and will skip tests based on size. Sorry, but I don't have the ability to post the code, but that is how we did it.
Here are some posts on how Google does it (we based our stuff on Google)
http://blog.utest.com/how-google-tests-software-small-medium-and-large/2011/04/
Upvotes: 2