jenkinsci / build-timeout-plugin

Jenkins build-timeout plugin
https://plugins.jenkins.io/build-timeout/
31 stars 80 forks source link

Use JUnit Jupiter #122

Closed sghill-rewrite closed 1 year ago

sghill-rewrite commented 1 year ago

Hi @krisstern!

I saw #85 and thought I'd run it through the JUnit Jupiter migration from JUnit 4.x recipe on moderne.io. This got me most of the way there, then I was able to replace almost all of the JenkinsRule integration tests with the JUnit 5 WithJenkins annotation.

The one exception is BuildTimeoutWrapperIntegrationTest, which is still on JUnit 4 because the LocalData annotation on one test does not work with JUnit 5. I think this should be easy to create another way, but didn't want to add too much more to this PR.

Testing done

Ran mvn clean verify.

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
krisstern commented 1 year ago

Hi @sghill, thanks so much for the PR!

Let me take a look at BuildTimeoutWrapperIntegrationTest to see how I could refactor the code to switch to JUnit 5 if possible.