Skip to content

Run Android ITs#102

Open
jackpf wants to merge 3 commits intomainfrom
android-its
Open

Run Android ITs#102
jackpf wants to merge 3 commits intomainfrom
android-its

Conversation

@jackpf
Copy link
Owner

@jackpf jackpf commented Jan 17, 2026

Trying to get integration tests to run in GHA.

@jackpf jackpf added the WIP label Jan 17, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jackpf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on establishing a reliable workflow for running Android integration tests within a GitHub Actions environment. It modifies the test execution strategy to explicitly build and install APKs before running tests via ADB, and configures Gradle properties to mitigate potential flakiness by increasing timeouts and retry attempts. The changes aim to ensure that integration tests can consistently execute and provide feedback in the CI pipeline.

Highlights

  • Integration Test Execution Flow: The integration-test target in the client/Makefile has been revamped to use a multi-step process involving gradlew assemble, adb install for both debug and androidTest APKs, and finally adb shell am instrument to run the tests. This replaces the single gradlew connectedDebugAndroidTest command, likely to provide more control and visibility in CI environments.
  • Android Test Configuration Enhancements: Several properties have been added to client/gradle.properties to improve the robustness of Android test execution. These include increasing the ADB timeout to 5 minutes (android.adbOptions.timeOutInMs) and setting installation retries for the experimental Android test platform (android.experimental.androidTest.numInstallationRetries).
  • Temporary Debugging Test Case: A new test method, activityReachesResumedStatef(), has been introduced in MainActivityTest.java. This test includes an intentionally failing assertion (assertEquals(1, 2)), suggesting it's a temporary addition for debugging or verifying the test runner setup rather than a functional test.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build-client.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to get Android integration tests running in GitHub Actions. The changes involve updating the Makefile to run tests via adb commands and adjusting gradle.properties to make the CI environment more stable, which is a good approach. I've identified a critical issue: a new test has been added in MainActivityTest.java that will always fail, likely for debugging. This must be removed before merging as it breaks the CI build. I've also included a suggestion to clean up a commented-out line in the Makefile for better code clarity.

Comment on lines 31 to 37
@Test
public void activityReachesResumedStatef() {
try (ActivityScenario<MainActivity> scenario = ActivityScenario.launch(MainActivity.class)) {
assertEquals(Lifecycle.State.RESUMED, scenario.getState());
assertEquals(1, 2);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This test method activityReachesResumedStatef appears to be temporary code for debugging, as it contains an assertion assertEquals(1, 2); that will always fail. This will break the CI build. Please remove this test method before merging. The method name also seems to have a typo.

.PHONY: integration-test
integration-test:
./gradlew connectedDebugAndroidTest
#./gradlew connectedDebugAndroidTest -Pandroid.experimental.androidTest.useUnifiedTestPlatform=false --no-daemon --info
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This commented-out line appears to be from a previous implementation. To improve code clarity and maintainability, it's best to remove unused, commented-out code.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant