Skip to content

Flamingo: Fix unit tests (MockitoException at TypeCache.java) #5339

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

Closed
Tracked by #5308
nicolas-raoul opened this issue Oct 16, 2023 · 12 comments
Closed
Tracked by #5308

Flamingo: Fix unit tests (MockitoException at TypeCache.java) #5339

nicolas-raoul opened this issue Oct 16, 2023 · 12 comments

Comments

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Oct 16, 2023

High-priority, so anyone feel free to send a pull request for this.
In other words, no need to ask to get assigned, everyone can start working on it immediately if they wish. :-)


This branch is compatible with Flamingo (the latest Android studio):
https://github.com/commons-app/apps-android-commons/tree/v4.2.0-release (based on Siva's branch )
And it runs well on devices.

Unfortunately, all unit tests fail with this stacktrace:

FAILED
    org.mockito.exceptions.base.MockitoException at TestCommonsApplication.kt:81
        Caused by: org.mockito.exceptions.base.MockitoException at TypeCache.java:152
            Caused by: java.lang.IllegalStateException at InlineBytecodeGenerator.java:177
                Caused by: java.lang.IllegalArgumentException at ClassReader.java:184

It happens since that branch switched to Flamingo and to a higher JDK level.
Updating jacoco.gradle's toolVersion to 0.8.10 alone does not fix the unit tests, but it is probably worth doing.
In app/build.gradle I see that we are using 2.* mockito packages, while the latest versions seem to be 5.*, time to update maybe?
Some other packages may need to be updated too.
There is a possibility that some code changes may be needed.

Your task:

  1. Pull from the branch above
  2. Make the unit tests work (it is fine if a few still fail)
  3. Send a pull request

To fix the unit tests, an idea could be to update version numbers of testing/mock-related packages. The latest stable version numbers can be seen on each project's website. Another idea could be searching for similar exceptions on Stack Overflow.

This is high priority because it prevents us from making our main branch Flamingo-friendly.
Looking forward to your pull requests. :-)

@Sullynr2Wolf

This comment was marked as outdated.

@nicolas-raoul

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@nicolas-raoul

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@nicolas-raoul

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@nicolas-raoul

This comment was marked as outdated.

@Sullynr2Wolf

This comment was marked as outdated.

@nicolas-raoul

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants