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

[Bug]: JVM unit tests are not executed on CI #1546

Open
3 tasks done
SimonMarquis opened this issue Jul 12, 2024 · 5 comments
Open
3 tasks done

[Bug]: JVM unit tests are not executed on CI #1546

SimonMarquis opened this issue Jul 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@SimonMarquis
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

Since the recent merge of this PR

, the :core:common module is now a pure JVM module.

Unfortunately, the CI currently only runs Android tests:

run: ./gradlew testDemoDebug :lint:test

This also brought up this issue with missing test dependencies that were not visible on CI builds:

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@SimonMarquis SimonMarquis added the bug Something isn't working label Jul 12, 2024
@JoseAlcerreca
Copy link
Contributor

How do you suggest we run all the JVM tests? I wouldn't want to specify every JVM module in the command.

@SimonMarquis
Copy link
Contributor Author

A solution to this could be to do something similar to slackhq/slack-gradle-plugin's UnitTest.kt that creates a global ciUnitTest task that executed the JVM default test tasks as well as the chosen test${variant}UnitTest Android test task.
This worked for us with an even simpler setup on adevinta/spark-android.

@alexvanyo
Copy link
Contributor

I would prefer switching over to a built-in umbrella task like check if we can, as that would avoid other cases like this in the future where there's a new type of check that we forget to add to CI.

If check runs too much, maybe we can look into something like switching to single-variant Android modules.

@Jaehwa-Noh
Copy link
Contributor

What about add task with dependsOn at JVM module's gradle?
https://docs.gradle.org/current/userguide/controlling_task_execution.html#sec:adding_dependencies_to_tasks

If the CI merely check demoDebugTest, you can make dependency with that.

SimonMarquis added a commit to SimonMarquis/nowinandroid that referenced this issue Oct 13, 2024
`:core:common` module would not be able to run its unit test: `:core:common:test`

Related to: android#1546
@SimonMarquis
Copy link
Contributor Author

I would prefer switching over to a built-in umbrella task like check if we can, as that would avoid other cases like this in the future where there's a new type of check that we forget to add to CI.

I think this is a bad idea for this type of project. We have a wide variety of "checks" in Android projects: unit tests, instrumented tests, screenshot tests, lints checks, etc.
Having a single "umbrella" for running all tests might seem a good idea, but in practice, we will never use it. Even the CI is already splitted in "logical" groups of checks. For memory, performance, parallelization and even clarity reasons.
That is why I proposed we follow the solution to group similar checks into distinct umbrellas. ciUnitTests, ciAndroidTests, ciLint, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants