Skip to content
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

Migrate tests to JUnit5 #3221

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

strangelookingnerd
Copy link

There are already some tests that already use JUnit5 as well as some pending PRs (#3219, #3218, ...) to migrate more. This PR will migrate all (*) tests to JUnit5.

Migration includes:

  • Using JUnit5 annotations
  • Using Assertions
  • Remove public modifiers from test classes and methods
  • Clean up assertions (switching expected and actual, simplyifing assertions...)
  • Trivial code cleanup

I validated my changes using ./mvnw verify and

(*) Some tests use org.junit.Rule implementations that do not have a JUnit5 replacement and implementing these is non-trivial from what I can tell. Further there are some instances of other testing frameworks that do not yet support JUnit5. I plan on looking into these cases as well but deliberately did not include them in this PR.

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (if it fails due to code formatting issues reported by Spotless, simply run ./mvnw spotless:apply and retry)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests for the changes are provided
  • Commits are signed (optional, but highly recommended)

@ppkarwasz
Copy link
Contributor

@strangelookingnerd,

It will take me some time to scroll through all the changes in this PR, but I'll try to review this and your other PRs by the end of next week.

Copy link

github-actions bot commented Nov 20, 2024

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

@ppkarwasz
Copy link
Contributor

@strangelookingnerd,

Do you have a deadline for the "Migrate to JUnit 5" task? We are swamped with work these days, so the review might take more time than anticipated.

@strangelookingnerd
Copy link
Author

@strangelookingnerd,

Do you have a deadline for the "Migrate to JUnit 5" task? We are swamped with work these days, so the review might take more time than anticipated.

Not at all. I fully understand that the changeset is quite large and will take its time to review. I still hope that it will be merged eventually and I will try my best to keept it up-to-date and free of merge confilict 👍🏼

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

Successfully merging this pull request may close these issues.

2 participants