Skip to content

Update the tests to JUnit 5#238

Merged
garydgregory merged 2 commits into
apache:masterfrom
DamnedElric:master
Feb 28, 2024
Merged

Update the tests to JUnit 5#238
garydgregory merged 2 commits into
apache:masterfrom
DamnedElric:master

Conversation

@DamnedElric

Copy link
Copy Markdown
Contributor

This removes references to JUnit 4 test constructions and switches all tests to JUnit 5.

Unfortunately, JUnit 5's assertions have swapped the optional "message" argument from first to last, this makes the diff bigger than it would have otherwise been.

@codecov-commenter

codecov-commenter commented Feb 27, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.09%. Comparing base (9f6b23b) to head (96f0e32).
⚠️ Report is 685 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #238      +/-   ##
============================================
+ Coverage     91.90%   92.09%   +0.19%     
- Complexity      575      592      +17     
============================================
  Files            22       22              
  Lines          1247     1265      +18     
  Branches        210      211       +1     
============================================
+ Hits           1146     1165      +19     
+ Misses           63       60       -3     
- Partials         38       40       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@garydgregory

garydgregory commented Feb 27, 2024

Copy link
Copy Markdown
Member

Hello @DamnedElric

Thank you for your PR.
Run mvn by itself to run the default Maven goal and catch all build errors.
See also the new test merged from #237

@Claudenw

Copy link
Copy Markdown
Contributor

I like the idea and I know it is a big task. I did similar work for the RAT project recently.

@DamnedElric

Copy link
Copy Markdown
Contributor Author

Run mvn by itself to run the default Maven goal and catch all build errors

Ah my bad, I ran the test and install targets, but I didn't notice that there was a default target which included checkstyle. Will patch that tonight, and include #237.

I might create a future MR which refactors some of the tests to use a more idiomatic JUnit 5 style where it improves readability.

This removes references to JUnit 4 test constructions and switches all
tests to JUnit 5.

Unfortunately, JUnit 5's assertions have swapped the optional "message"
argument from first to last, this makes the diff bigger than it would
have otherwise been.
@DamnedElric

DamnedElric commented Feb 27, 2024

Copy link
Copy Markdown
Contributor Author

@garydgregory Made some changes to fix the checkstyle errors, and included all other recent changes to the master branch. Should be green now :)

Edit: technically speaking, the junit-vintage-engine dependency can now be replaced by junit-jupiter-engine, this would prevent any new old-style tests from being introduced. Not sure if we want to go that way?

@garydgregory

Copy link
Copy Markdown
Member

@garydgregory Made some changes to fix the checkstyle errors, and included all other recent changes to the master branch. Should be green now :)

Edit: technically speaking, the junit-vintage-engine dependency can now be replaced by junit-jupiter-engine, this would prevent any new old-style tests from being introduced. Not sure if we want to go that way?

@DamnedElric
Yes, let's please migrate away from the vintage layer. I want to avoid anything non-version 5 from sneaking back in.

@DamnedElric

Copy link
Copy Markdown
Contributor Author

@DamnedElric Yes, let's please migrate away from the vintage layer. I want to avoid anything non-version 5 from sneaking back in.

@garydgregory Done :-)

@garydgregory garydgregory merged commit c4c3886 into apache:master Feb 28, 2024
@garydgregory

Copy link
Copy Markdown
Member

TY @DamnedElric !

garydgregory added a commit that referenced this pull request Feb 28, 2024
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.

4 participants