Skip to content

ci: align Android unit test task names with KMP conventions [WPB-23848]#3930

Closed
MohamadJaara wants to merge 5 commits intodevelopfrom
mo/ci/android-unit-tests-not-running
Closed

ci: align Android unit test task names with KMP conventions [WPB-23848]#3930
MohamadJaara wants to merge 5 commits intodevelopfrom
mo/ci/android-unit-tests-not-running

Conversation

@MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Mar 4, 2026

https://wearezeta.atlassian.net/browse/WPB-23848

PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • The android-tests job in the release CI pipeline (build-kalium-unified.yml) was failing when running ./gradlew testAndroidHostTest.
  • The PR CI pipeline (androidUnitOnlyAffectedTest) was silently running zero Android unit tests because it was looking for a testDebugUnitTest task that no longer exists.
  • The runAllUnitTests root task was also silently skipping all Android unit tests for the same reason.

Causes

After the migration to Kotlin Multiplatform's Android target, the test task was renamed from testDebugUnitTest to testAndroidHostTest. Several places in the build scripts and CI workflows still referenced the old name. Because task lookups used findByName (which returns null on miss) rather than failing loudly, this went undetected — the tasks simply ran with no test dependencies.

Additionally, the root-level build.gradle.kts was resolving subproject tasks eagerly during configuration, before KMP plugins had registered them, causing findByName to always return null regardless of the task name.

Solutions

  • OnlyAffectedTestTask.kt: Updated ANDROID_UNIT_TEST_TASK test target from testDebugUnitTest to testAndroidHostTest so the PR workflow actually discovers and runs tests.
  • build.gradle.kts:
    • Added a new runAndroidUnitTests root task that aggregates testAndroidHostTest across all subprojects (excluding :core:cryptography).
    • Fixed both runAndroidUnitTests and runAllUnitTests to use gradle.projectsEvaluated instead of eager findByName, ensuring tasks are resolved after all subprojects are fully configured.
    • Updated task name references from testDebugUnitTest to testAndroidHostTest.
  • build-kalium-unified.yml: Replaced ./gradlew testAndroidHostTest -x :core:cryptography:testAndroidHostTest with ./gradlew runAndroidUnitTests. Added fetch-depth: 0 and the sample build step to match the PR workflow.
  • gradle-android-unit-tests.yml: Updated artifact collection paths from testDebugUnitTest to testAndroidHostTest.
  • test-android-unit-tests-manual.yml (new): Added a workflow_dispatch workflow to manually trigger the Android unit tests from any branch for validation.

Testing

How to Test

  1. Verify locally that the task resolves correctly:

    ./gradlew runAndroidUnitTests --dry-run
    

    Should list testAndroidHostTest for all subprojects except :core:cryptography.

  2. Push the branch and trigger the "Test Android Unit Tests (Manual)" workflow from the Actions tab to validate on CI.

  3. Verify the PR workflow by opening/syncing a PR — androidUnitOnlyAffectedTest should now print Adding task: :<module>:testAndroidHostTest lines for affected modules.

Notes


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@MohamadJaara MohamadJaara changed the title ci: align Android unit test task names with KMP conventions ci: align Android unit test task names with KMP conventions [WPB-23848] Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Test Results

0 tests   - 4 509   0 ✅  - 4 392   0s ⏱️ - 2m 32s
0 suites  -   747   0 💤  -   117 
0 files    -   747   0 ❌ ±    0 

Results for commit 191734a. ± Comparison against base commit 0b49597.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.24%. Comparing base (0b49597) to head (191734a).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3930      +/-   ##
===========================================
- Coverage    59.25%   59.24%   -0.02%     
===========================================
  Files         1953     1961       +8     
  Lines        62652    62849     +197     
  Branches      6817     6826       +9     
===========================================
+ Hits         37125    37234     +109     
- Misses       22478    22563      +85     
- Partials      3049     3052       +3     

see 17 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b49597...191734a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants