Skip to content

Add tests for conversation screen#125

Open
RankoR wants to merge 38 commits into
GrapheneOS:mainfrom
RankoR-GOS:task/conversation-compose-tests
Open

Add tests for conversation screen#125
RankoR wants to merge 38 commits into
GrapheneOS:mainfrom
RankoR-GOS:task/conversation-compose-tests

Conversation

@RankoR

@RankoR RankoR commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Last (of 3) PR with Conversation screen rewritten with Kotlin and Compose.

Adds:

  • Unit and Instrumented tests. Used Robolectric unit tests where possible
  • Coverage verification and enforcement

Coverage:

  • Unit: 93% instructions, 74% branches
  • Instrumented: 88% instructions, 62% branches

Doesn't change behavior of production code. All production code changes are:

  • Added tags for tests
  • Removed one unused method

@RankoR RankoR force-pushed the task/conversation-compose-tests branch from ccda3e6 to 72659cb Compare June 2, 2026 15:30
@RankoR RankoR marked this pull request as ready for review June 2, 2026 20:40
@RankoR RankoR requested review from inthewaves and m4pl June 2, 2026 20:40
@RankoR RankoR force-pushed the task/conversation-compose-tests branch 4 times, most recently from 84902aa to ab70f29 Compare June 3, 2026 17:31
@RankoR RankoR force-pushed the task/conversation-compose-tests branch from ab70f29 to 8bbe3b9 Compare June 4, 2026 09:36
@RankoR RankoR requested a review from inthewaves June 6, 2026 22:43
Comment on lines +161 to +173
- name: Run instrumented tests and coverage gate
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a
with:
api-level: 36
arch: x86_64
target: default
disable-animations: true
script: >
./gradlew :app:connectedDebugAndroidTest :app:jacocoAndroidTestVerification
-PandroidTestCoverage=true
-PandroidTestMinCoverage=80
-PandroidTestMinBranchCoverage=50
--no-daemon --stacktrace --console=plain

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about caching the AVD snapshot? Could shave off the cold emulator boot each run

Comment thread app/jacoco-rules/common/excluded-class-patterns.txt Outdated
Comment thread src/com/android/messaging/ui/conversation/composer/ui/ConversationComposeBar.kt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this test lives under messages/mapper, but the mapper under test is in ui/conversation/attachment/mapper. Moving it to the matching package/path would make ownership clearer

}

@Test
fun commandMethods_doNothingWhenConversationIdIsBlankOrNull() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test says the commands should do nothing for blank/null conversation ids, but it only checks effects and confirmation state

@RankoR RankoR force-pushed the task/conversation-compose-tests branch from 6090a5e to 1510d5b Compare June 11, 2026 18:40
@RankoR RankoR force-pushed the task/conversation-compose-tests branch from 82d6f1f to d04b9cf Compare June 11, 2026 19:54
@RankoR RankoR requested a review from inthewaves June 11, 2026 20:08
@inthewaves

Copy link
Copy Markdown
Member

This branch has conflicts that must be resolved

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants