On Thu, Feb 19, 2015 at 11:36 AM, Kirill <[email protected]> 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. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0r8xdgOkEeS9o8-VL4_D_ERh7f-NDvY7tvdTyW3eX8fQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
