Skip to content

Integration Tests - Use @Rule instead of @ClassRule for JenkinsRule unless required #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gbhat618 opened this issue Jan 2, 2025 · 0 comments

Comments

@gbhat618
Copy link
Contributor

gbhat618 commented Jan 2, 2025

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)

@gbhat618 gbhat618 mentioned this issue Jan 2, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant