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

[Tests] Upgrade to Junit5 #2006

Merged
merged 2 commits into from Feb 29, 2024
Merged

[Tests] Upgrade to Junit5 #2006

merged 2 commits into from Feb 29, 2024

Conversation

jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Feb 24, 2024

Description

One Line Summary

JUnit 5 supports better test result output with Kotest and a number of other features.

Motivation

  • Make nested test easier to read in the report output.
  • JUnit 4 is not get any new features, and at this point probably only gets security fixes.

Scope

Only unit tests, only upgrading JUnit 4 -> 5.

Testing

Unit testing

Unit tests pass locally and on CI

Manual testing

No production source was changed.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

JUnit 5 supports better test result output with Kotest and number of
other features. JUnit 4 is not get any new features, and at this point
probably only gets security fixes.
@jkasten2 jkasten2 changed the title WIP - [Tests] Upgrade to Junit5 [Tests] Upgrade to Junit5 Feb 26, 2024
Base automatically changed from fix/json-ext-functions to main February 28, 2024 18:31
Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The testhelpers module still uses junitVersion = '4.13.2'.
Because that module does not have tests, unlike the other modules in this PR?

Robolectric only has a JUnit 4 interface, however we are adapting it via
RobolectricExtension.kt. However this means we still require a reference
to JUnit4 in this specific testhelpers to do this.
@jkasten2
Copy link
Member Author

jkasten2 commented Feb 29, 2024

@nan-li Good catch! I completely missed this module. I pushed a commit to address what I could here, details in the commit and below.

I was able to update it's Kotest usage to JUnit5, but had to keep a JUnit4 reference for the code that adapts Robolectric's JUnit4 interface to Kotest's JUnit5 interface.

@nan-li nan-li self-requested a review February 29, 2024 19:15
@jkasten2 jkasten2 merged commit 221a02e into main Feb 29, 2024
2 checks passed
@jkasten2 jkasten2 deleted the tests/upgrade-to-junit5 branch February 29, 2024 19:20
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.

None yet

2 participants