General best practice around using @Rule vs @ClassRule for JenkinsRule is
- if the jenkins configuration is being modified between different tests; then it is preferred to use the
@Rule
- if it was simply requiring jenkins without doing jenkins modification itself, then use
@ClassRule.
In that sense, currently majority of the integration tests are all modifying the JenkinsRule (in the init method), as well as various small assertions being put in different test methods.
This is actually causing issues,
- for extending the tests
- and other configurations around tests such as using
@WithTimeout (currently being compensated by putting timeout configs in pom.xml file)
It is better to simplify the integration tests such that it is easier to follow.
Also see #495 (comment)