Skip to content

dataconnect: include relevant logcat snippets in github actions logs when androidTest tests fail #6902

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

Merged
merged 6 commits into from
May 6, 2025

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Apr 22, 2025

With this PR, the GitHub Actions workflow output includes relevant snippets from the logcat logs for failed tests. Before this PR, one would need to manually download the logcat log file from the workflow artifacts and grok it themselves.

The new github actions log output looks something like this:

+ python firebase-dataconnect/ci/logcat_error_report.py --logcat-file=logcat.log
Extracting test failures from logcat.log
FAILED TEST: forcedFailureRevertMeBeforeMerging(com.google.firebase.dataconnect.AnyScalarIntegrationTest)
Found results for 423 tests:422 passed, 1 failed
Failure 1/1: forcedFailureRevertMeBeforeMerging(com.google.firebase.dataconnect.AnyScalarIntegrationTest):
04-22 20:[42](https://github.com/firebase/firebase-android-sdk/actions/runs/14604151406/job/40969205145?pr=6902#step:22:43):12.156  2453  2474 I TestRunner: started: forcedFailureRevertMeBeforeMerging(com.google.firebase.dataconnect.AnyScalarIntegrationTest)
04-22 20:42:12.157  2453  2477 D FirebaseDataConnect: [16.0.1] LogLevelChange[id=lgrnhsm8663jy] Log level changed to DEBUG (was WARN)
04-22 20:42:12.158  2453  2474 E TestRunner: failed: forcedFailureRevertMeBeforeMerging(com.google.firebase.dataconnect.AnyScalarIntegrationTest)
04-22 20:42:12.158  2[45](https://github.com/firebase/firebase-android-sdk/actions/runs/14604151406/job/40969205145?pr=6902#step:22:46)3  2474 E TestRunner: ----- begin exception -----
04-22 20:42:12.158  2453  2477 D FirebaseDataConnect: [16.0.1] LogLevelChange[id=lgrnhsm8663jy] Log level changed to WARN (was DEBUG)
04-22 20:42:12.159  2453  2[47](https://github.com/firebase/firebase-android-sdk/actions/runs/14604151406/job/40969205145?pr=6902#step:22:48)4 E TestRunner: java.lang.Exception: vzmht3nbgr forced error!
04-22 20:42:12.159  2453  2474 E TestRunner: 	at com.google.firebase.dataconnect.AnyScalarIntegrationTest.forcedFailureRevertMeBeforeMerging(AnyScalarIntegrationTest.kt:72)
04-22 20:42:12.159  2453  2474 E TestRunner: 	at java.lang.reflect.Method.invoke(Native Method)
04-22 20:42:12.159  2453  2474 E TestRunner: 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
04-22 20:42:12.159  2453  2474 E TestRunner: 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

See https://github.com/firebase/firebase-android-sdk/actions/runs/14604151406/job/40969205145?pr=6902

9SFCnNzo2W3C93z

Copy link
Contributor

github-actions bot commented Apr 22, 2025

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

Copy link
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_responses.sh should be updated to clone the latest version of the responses: v10.0

Copy link
Contributor

github-actions bot commented Apr 22, 2025

Test Results

 1 056 files  + 1 012   1 056 suites  +1 012   35m 45s ⏱️ + 29m 34s
 5 974 tests + 5 838   5 952 ✅ + 5 816  22 💤 +22  0 ❌ ±0 
12 011 runs  +11 719  11 967 ✅ +11 675  44 💤 +44  0 ❌ ±0 

Results for commit d6355ae. ± Comparison against base commit 4c4c7c9.

♻️ This comment has been updated with latest results.

@dconeybe dconeybe requested a review from Copilot April 22, 2025 20:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the GitHub Actions workflow to automatically output relevant logcat snippets when Android tests fail. Key changes include:

  • Updating the GitHub Actions workflow to check for and process logcat.log files.
  • Adding a new logcat error reporting script (with associated tests) that extracts and formats output from test failures.
  • Adjusting linting rules and the CI command in the README to align with these new behaviors.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
firebase-dataconnect/ci/pyproject.toml Updated linting rules to ignore function complexity and branch count issues.
firebase-dataconnect/ci/logcat_error_report_test.py Added tests for validating regex patterns for logcat extraction.
firebase-dataconnect/ci/logcat_error_report.py Introduced a new script to extract and output logcat snippets on failed tests.
firebase-dataconnect/ci/README.md Updated the CI command to include automatic lint fixing before testing.
.github/workflows/dataconnect.yml Modified the workflow to install Python, handle missing logcat files, and invoke the logcat reporting script.
Comments suppressed due to low confidence (1)

.github/workflows/dataconnect.yml:240

  • The token 'dsdta43sxk' in the warning message appears arbitrary and may be unclear to other developers; consider replacing it with a more descriptive identifier or removing it altogether.
echo "WARNING dsdta43sxk: logcat log file not found; skipping scanning for test failures" >&2

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 22, 2025

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 22, 2025

Startup Time Report 1

The report is too large (122,579 chars) to be displayed on GitHub. Please check this report on GCS.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Ip2mhz3km3/index.html

@dconeybe dconeybe marked this pull request as ready for review April 22, 2025 21:42
@dconeybe dconeybe requested a review from aashishpatil-g April 22, 2025 21:57
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 22, 2025

Coverage Report 1

Affected Products

  • firebase-database

    Overall coverage changed from 50.21% (4c4c7c9) to 50.20% (41fa3d5) by -0.01%.

    FilenameBase (4c4c7c9)Merge (41fa3d5)Diff
    BooleanNode.java92.31%100.00%+7.69%
    DefaultPersistenceManager.java75.73%74.76%-0.97%
    ViewProcessor.java92.10%91.79%-0.30%
  • firebase-messaging

    Overall coverage changed from 84.13% (4c4c7c9) to 84.10% (41fa3d5) by -0.04%.

    FilenameBase (4c4c7c9)Merge (41fa3d5)Diff
    FirebaseMessaging.java76.00%75.60%-0.40%
  • firebase-sessions

    Overall coverage changed from 66.67% (4c4c7c9) to 66.56% (41fa3d5) by -0.11%.

    FilenameBase (4c4c7c9)Merge (41fa3d5)Diff
    RemoteSettings.kt88.73%87.32%-1.41%
  • firebase-storage

    Overall coverage changed from 83.92% (4c4c7c9) to 83.96% (41fa3d5) by +0.04%.

    FilenameBase (4c4c7c9)Merge (41fa3d5)Diff
    StreamDownloadTask.java88.41%88.89%+0.48%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/zzyQD24Odq.html

@dconeybe dconeybe merged commit 88f50d5 into main May 6, 2025
433 of 434 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/CiParseErrorsFromLogcat branch May 6, 2025 22:16
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.

3 participants