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

Introduce regression test suite for Android ecosystem #2341

Open
TimvdLippe opened this issue Jun 22, 2021 · 6 comments
Open

Introduce regression test suite for Android ecosystem #2341

TimvdLippe opened this issue Jun 22, 2021 · 6 comments

Comments

@TimvdLippe
Copy link
Contributor

Per #2340 (comment)

We should work on a test suite to prevent issues such as #2316 #2327 and #2340. Ultimately this should then also catch issues that arise in ByteBuddy with the bytecode magic that Mockito implicitly depends on.

CC @robpridham-bbc

@Jacks0N23
Copy link

Jacks0N23 commented Jun 27, 2021

I found out that it's because of new Kotlin compiler backend.
if switch back to useOldBackend = true than everything works fine on 3.11.2
Found issue on JB tracker and describe everything that I figured out
https://youtrack.jetbrains.com/issue/IDEA-272487

@TimvdLippe
Copy link
Contributor Author

For anyone who is interested in contributing, the regression test suite should have minimal impact on our toolchain and setup, while still catching the most basic issues.

@chaehwanli
Copy link

@TimvdLippe
I want to support it.
Could you more explain about "regression test suite for android ecosystem"? :)

@TimvdLippe
Copy link
Contributor Author

@chaehwanli We want to have regression tests that will fail if we were to break use cases such as #2327 In the simplest terms, we want to have the following regression test added to our project:

class DummyTest {
  @Test
  fun test() {
    Mockito.mock(Foo::class.java)
  }
}

This test should pass with all the required Android ecosystem dependencies and if we were to break it again, the test should fail accordingly.

@robpridham-bbc
Copy link
Contributor

I've started looking at this but not got very far.

One challenge is that an Android project is essentially incompatible with a standard Java/Kotlin parent. We can certainly create an Android project within the parent structure, i.e. an 'androidTest' folder here, but it would need to be opened separately with Android Studio and it would have no knowledge of its parent.

Therefore it would need to reference some Mockito artefact(s), just like any other consumer, and I imagine that normally when you're running these tests, you would expect it to link to the development version of Mockito rather than having to publish somewhere first. Publishing is feasible - in my work, we use a local Maven repo to publish snapshot builds from one project and then reference them in another - but I don't want to unilaterally impose a particular workflow.

I think we would benefit from a high level discussion outside of this issue back-and-forth - a call or something - if you can make some time available.

@TimvdLippe
Copy link
Contributor Author

@robpridham-bbc Ah thanks for taking a look at this! I have time this week to chat through this and I think we are both in the UK timezone. Could you send me an email to me to discuss potential timeslots?

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

4 participants