Thanks a million, Jesse! Your suggestion about JenkinsRule being a @ClassRule rather than a @Rule was a shot in the bulls eye! I changed @ClassRule to @Rule and it works fine!
Regards, Kirill. пятница, 20 февраля 2015 г., 20:40:23 UTC пользователь Jesse Glick написал: > > On Thu, Feb 19, 2015 at 11:36 AM, Kirill <[email protected] <javascript:>> > 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/3085f1bd-5536-4c92-b061-1b5b867de344%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
