On Thu, Feb 19, 2015 at 11:36 AM, Kirill <
yam...@gmail.com> wrote:
> how does Jenkins JUnit rule organize tests if I run tests via Surefire
> Maven plugin without any custom settings (so it's 1 JVM and threads are
> reused)?
Depending on the parent POM version, there may be tests run in
parallel, but never >1 per JVM.
> is Jenkins instance shared by all the tests?
No. Each test case gets its own Jenkins.instance, $JENKINS_HOME, HTTP port, etc.
(Unless you make JenkinsRule a @ClassRule rather than a @Rule. This is
rarely done, but it is an option if you are concerned about overhead
and none of the test cases within this suite actually change any
settings or create any items, but merely rely on Jenkins services
being loaded.)
> I have a few tests that delete all the projects
No need to delete projects unless they were created earlier in the
same test case (@Test method).
> then create the project with the same name -
> MY_PROJECT on set up (annotated by @Before). However, sometimes tests fail
> complaining that MY_PROJECT already exists - but quite rarely, probably 1 in
> 10 times.
I have never seen such a thing happen. Perhaps your test is doing
something unusual, or your plugin has an odd flaw.