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 kt tests off hamcrest #13888

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

jamesonwilliams
Copy link
Contributor

@jamesonwilliams jamesonwilliams commented Jan 8, 2025

Contributor checklist

  • MacBook (unit tests)
  • Pixel 8 API 34 emulator (connected tests)
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

In #13884, I am migrating the remaining Java/Hamcrest tests to Kotlin/AssertK.

In this PR, I am migrating the remaining Kotlin/Hamcrest tests to Kotlin/Assert. There are uses of Hamcrest in both the unit and connected device tests. A good number of these are under-the-hood via helper functions in KotlinAssertsUtil.kt and TestUtils.kt.

To find the remaining Kotlin files that still use Hamcrest, I used:

 rg hamcrest $(git ls-files "app*.kt") $(git ls-files "*lib*kt")

And replaced every call site with the equivalent AssertK expression. (Frequently using a find/replace regex and then cleaning up by hand.)

Testing

./gradlew qa
[...snip...]
BUILD SUCCESSFUL in 3m 15s
./gradlew :Signal-Android:connectedPlayProdInstrumentationAndroidTest
[...snip...]

^ FixInAppCurrencyIfAbleTest fails; but it does without these changes, too. So, the results of the suite are unchanged, and the failure is not related to this set of changes.

@jamesonwilliams jamesonwilliams marked this pull request as ready for review January 8, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant