Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change enhances the Android PR CI workflow to run tests against multiple JDK versions (Current/8, 11, 17, 21, 25) concurrently. It introduces JDK_HOME support in build scripts and adds logic to cn1ss.sh to enforce failure on screenshot mismatches and suppress redundant PR comments for the new matrix jobs, while preserving the existing behavior for the default run.


PR created automatically by Jules for task 3144219580189981125 started by @shai-almog

… 25.

- Updated `.github/workflows/scripts-android.yml` to use a matrix strategy for JDK versions.
- Modified `scripts/build-android-app.sh` and `scripts/run-android-instrumentation-tests.sh` to respect `JDK_HOME` env var.
- Updated `scripts/lib/cn1ss.sh` to support failing on screenshot mismatch and skipping PR comments via env vars `CN1SS_FAIL_ON_MISMATCH` and `CN1SS_SKIP_COMMENT`.
- Configured matrix jobs to fail on mismatch and skip comments for non-default JDKs.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

- Renamed 'current' matrix entry to 'Default: 8'.
- Removed JDK 11 and 25 from the matrix as requested.
- Updated conditional logic to skip artifact uploads (screenshots, coverage) for non-default runs to prevent conflicts.
- Updated test runner script block to skip coverage generation for non-default runs.
- Preserved existing logic for JDK setup and env vars for non-default runs.
- Refactored matrix to use `include` with `id`, `name`, and `java_version` to avoid string quoting issues and provide robust logic.
- Removed JDK 11 and 25 from the matrix as requested.
- Updated conditional logic to use `matrix.id` for checking default vs. custom jobs.
- Fixed artifact conflict by strictly limiting uploads to the `default` job using the robust `matrix.id == 'default'` check.
- Added explicit job name `Build Android ${{ matrix.name }}` for better visibility in PR checks.
@shai-almog
Copy link
Collaborator

shai-almog commented Dec 18, 2025

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.82% (2648/10667 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.43% (12299/50336), branch 15.39% (714/4640), complexity 17.51% (739/4220), method 32.84% (596/1815), class 34.98% (106/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidDB – 0.00% (0/57 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 24.82% (2648/10667 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.43% (12299/50336), branch 15.39% (714/4640), complexity 17.51% (739/4220), method 32.84% (596/1815), class 34.98% (106/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidDB – 0.00% (0/57 lines covered)

google-labs-jules bot and others added 3 commits December 18, 2025 11:07
- Removed malformed shell script block in `scripts-android.yml` that caused syntax errors in the emulator runner.
- Moved logic to skip coverage report generation into `run-android-instrumentation-tests.sh` using the `CN1SS_SKIP_COVERAGE` env var.
- Updated workflow to set `CN1SS_SKIP_COVERAGE=1` for non-default matrix jobs.
- Simplified `android-emulator-runner` script input to a single line command.
- Added "Free Disk Space" step for non-default matrix jobs to remove unused large packages (dotnet, ndk, ghc, swift) and prevent `Not enough space to create userdata partition` errors during emulator creation.
- Verified that `mvnw` Java version mismatch is non-blocking for the build process.
@shai-almog shai-almog marked this pull request as ready for review December 18, 2025 13:19
@shai-almog shai-almog merged commit 4583f44 into master Dec 18, 2025
13 of 15 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +412 to +415
if [ "${CN1SS_FAIL_ON_MISMATCH:-0}" = "1" ]; then
if [ -f "$summary_out" ] && (grep -q "^different|" "$summary_out" || grep -q "^error|" "$summary_out"); then
cn1ss_log "FATAL: Screenshot mismatches or errors detected (CN1SS_FAIL_ON_MISMATCH=1)"
return 15

Choose a reason for hiding this comment

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

P1 Badge Fail matrix runs on all CN1SS mismatches

The new CN1SS_FAIL_ON_MISMATCH guard only trips when the summary file contains different| or error|. RenderScreenshotReport emits other non‑success statuses such as missing_expected and missing_actual (e.g., when a reference PNG is absent or the test never produced a screenshot), but those are ignored here, so matrix jobs with CN1SS_FAIL_ON_MISMATCH=1 still exit 0 even though the comparison detected missing screenshots. That defeats the goal of failing non‑default JDK runs on visual regressions; a JDK‑specific omission would be silently green.

Useful? React with 👍 / 👎.

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.

2 participants