diff --git a/content/doc/developer/testing/index.adoc b/content/doc/developer/testing/index.adoc index 323d21ea0e7e..acf1df493d02 100644 --- a/content/doc/developer/testing/index.adoc +++ b/content/doc/developer/testing/index.adoc @@ -604,4 +604,11 @@ TODO: RestartableJenkinsRule. === Custom builder == Advanced and Tips etc. -//Tip: Use @ClassRule for JenkinsRule, if you're 900% sure that everything is ok + +This section covers advanced topics and tips to improve testing. + +=== `ClassRule` for `JenkinsRule` + +Use `@ClassRule` with `JenkinsRule` when you want to share a single Jenkins instance across all tests in the class, especially when you need to avoid repeated setup and teardown of the Jenkins environment. +It’s a great way to optimize your tests when you don’t need a fresh Jenkins instance for every single test method, but instead want to run tests that all rely on the same shared Jenkins setup. +The field annotated with `@ClassRule` must be static because it is shared across all instances of the test class.