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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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 034 files  +   968   1 034 suites  +968   34m 51s ⏱️ + 33m 32s
 5 874 tests + 5 322   5 852 ✅ + 5 301  22 💤 +21  0 ❌ ±0 
11 811 runs  +10 707  11 767 ✅ +10 665  44 💤 +42  0 ❌ ±0 

Results for commit f1ec66c. ± Comparison against base commit 534cc53.

♻️ 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
Copy link
Contributor

google-oss-bot commented Apr 22, 2025

Startup Time Report 1

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

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/4gizlYdoHu/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

Coverage Report 1

Affected Products

  • firebase-messaging

    Overall coverage changed from 84.10% (534cc53) to 84.13% (f63b6d9) by +0.04%.

    FilenameBase (534cc53)Merge (f63b6d9)Diff
    FirebaseMessaging.java76.80%76.00%-0.80%
    Metadata.java36.51%41.27%+4.76%
  • firebase-sessions

    Overall coverage changed from 66.56% (534cc53) to 66.67% (f63b6d9) by +0.11%.

    FilenameBase (534cc53)Merge (f63b6d9)Diff
    RemoteSettings.kt87.32%88.73%+1.41%
  • firebase-storage

    Overall coverage changed from 84.29% (534cc53) to 83.96% (f63b6d9) by -0.33%.

    FilenameBase (534cc53)Merge (f63b6d9)Diff
    StorageException.java69.09%65.45%-3.64%
    StorageTask.java83.99%83.38%-0.60%
    StreamDownloadTask.java88.41%88.89%+0.48%
    UploadTask.java83.17%81.52%-1.65%

Test Logs

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

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