Skip to content

Crashlytics smoke test stubs #2737

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
Jul 9, 2021
Merged

Crashlytics smoke test stubs #2737

merged 6 commits into from
Jul 9, 2021

Conversation

mrichards
Copy link
Contributor

No description provided.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 16, 2021

Coverage Report

Affected SDKs

  • firebase-database

    SDK overall coverage changed from 50.02% (1b0fdcf) to 50.07% (83fe61c0) by +0.05%.

    Filename Base (1b0fdcf) Head (83fe61c0) Diff
    ChildChangeAccumulator.java 83.33% 96.67% +13.33%
    QueryParams.java 89.76% 90.36% +0.60%
  • firebase-messaging

    SDK overall coverage changed from 83.56% (1b0fdcf) to 83.43% (83fe61c0) by -0.14%.

    Filename Base (1b0fdcf) Head (83fe61c0) Diff
    TopicsSubscriber.java 91.38% 89.66% -1.72%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (83fe61c0) is created by Prow via merging commits: 1b0fdcf 2f1569a.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 16, 2021

Binary Size Report

Affected SDKs

  • firebase-crashlytics

    Type Base (1b0fdcf) Head (83fe61c0) Diff
    aar 330 kB 330 kB +26 B (+0.0%)
    apk (release) 825 kB 825 kB -64 B (-0.0%)
  • firebase-crashlytics-ktx

    Type Base (1b0fdcf) Head (83fe61c0) Diff
    apk (release) 1.31 MB 1.31 MB -68 B (-0.0%)

Test Logs

Notes

Head commit (83fe61c0) is created by Prow via merging commits: 1b0fdcf 2f1569a.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 16, 2021

Macrobenchmark Report

Affected SDKs

Measurements are for head commit (a53c473). Diffing against base commit (c7d8a80) is working in progress.

  • baseline

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait122.0 ms154.0 ms134.5 ms153.0 ms153.8 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait41.0 ms65.0 ms51.5 ms61.4 ms65.0 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait58.0 ms92.0 ms75.0 ms83.7 ms91.6 ms
  • firebase-common

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait127.0 ms211.0 ms143.0 ms162.7 ms208.1 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait48.0 ms67.0 ms52.5 ms56.3 ms65.5 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait57.0 ms97.0 ms73.0 ms85.1 ms94.9 ms
  • firebase-config

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait117.0 ms174.0 ms141.0 ms159.3 ms171.7 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait43.0 ms89.0 ms53.5 ms62.5 ms84.8 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait56.0 ms89.0 ms70.5 ms83.2 ms88.2 ms
  • firebase-crashlytics

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait149.0 ms181.0 ms164.5 ms178.0 ms180.4 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait38.0 ms62.0 ms50.0 ms60.0 ms61.6 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait49.0 ms105.0 ms72.0 ms91.5 ms103.3 ms
  • firebase-database

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait120.0 ms171.0 ms140.5 ms147.1 ms168.3 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait43.0 ms72.0 ms50.5 ms58.4 ms70.1 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait57.0 ms88.0 ms73.0 ms81.1 ms86.9 ms
  • firebase-dynamic-links

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait138.0 ms167.0 ms152.5 ms162.1 ms166.2 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait38.0 ms75.0 ms59.5 ms73.0 ms74.6 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait56.0 ms88.0 ms77.5 ms84.4 ms88.0 ms
  • firebase-firestore

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait127.0 ms162.0 ms142.0 ms148.7 ms160.7 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait35.0 ms68.0 ms52.5 ms64.0 ms67.2 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait52.0 ms90.0 ms74.5 ms85.3 ms89.6 ms
  • firebase-functions

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait124.0 ms170.0 ms147.0 ms160.1 ms168.3 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait43.0 ms73.0 ms52.5 ms60.1 ms70.7 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait53.0 ms95.0 ms75.5 ms92.2 ms94.8 ms
  • firebase-inappmessaging-display

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait155.0 ms204.0 ms181.0 ms189.4 ms201.9 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait38.0 ms66.0 ms54.0 ms62.3 ms65.8 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait64.0 ms108.0 ms81.0 ms94.0 ms105.3 ms
  • firebase-messaging

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait130.0 ms178.0 ms147.5 ms161.8 ms176.3 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait34.0 ms67.0 ms56.5 ms62.4 ms66.8 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait54.0 ms94.0 ms70.5 ms80.1 ms91.5 ms
  • firebase-perf

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait151.0 ms178.0 ms159.0 ms173.0 ms177.1 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait41.0 ms73.0 ms53.0 ms68.3 ms72.6 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait58.0 ms101.0 ms72.5 ms87.4 ms99.1 ms
  • firebase-storage

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait131.0 ms164.0 ms148.5 ms158.3 ms163.4 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait38.0 ms70.0 ms52.0 ms65.2 ms69.4 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait63.0 ms86.0 ms76.0 ms80.5 ms85.8 ms

@mrichards mrichards force-pushed the crashlytics-smoke-tests branch 5 times, most recently from 5727629 to acfe867 Compare June 25, 2021 19:26
@mrichards mrichards force-pushed the crashlytics-smoke-tests branch 2 times, most recently from 1431376 to 03afcd7 Compare June 29, 2021 18:24
One test validates the Analytics integration; the rest are simple stubbs for now.
@mrichards mrichards force-pushed the crashlytics-smoke-tests branch from 03afcd7 to 5ab83f5 Compare June 29, 2021 18:55
@mrichards mrichards marked this pull request as ready for review June 29, 2021 20:07
@mrichards mrichards requested a review from yifanyang June 29, 2021 20:07
@mrichards mrichards changed the title Crashlytics smoke test stubbs Crashlytics smoke test stubs Jun 29, 2021
Copy link
Contributor

@yifanyang yifanyang left a comment

Choose a reason for hiding this comment

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

Thanks for adding this test! LGTM.

Object core = coreField.get(crashlytics);
Field breadcrumbSourceField = core.getClass().getDeclaredField("breadcrumbSource");
breadcrumbSourceField.setAccessible(true);
BreadcrumbSource breadcrumbSource = (BreadcrumbSource)breadcrumbSourceField.get(core);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
BreadcrumbSource breadcrumbSource = (BreadcrumbSource)breadcrumbSourceField.get(core);
BreadcrumbSource breadcrumbSource = (BreadcrumbSource) breadcrumbSourceField.get(core);

@yifanyang
Copy link
Contributor

/retest

@yifanyang yifanyang requested a review from vkryachko June 30, 2021 18:06
@yifanyang
Copy link
Contributor

@vkryachko Adding you as a reviewer about the reflections and additional proguard rules.

try {
// need to use reflection to get the breadcrumb handler.
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
Field coreField = crashlytics.getClass().getDeclaredField("core");
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this use of reflection could cause maintenance problems down the road.

There seems to be an easy workaround, given the following observation: core is not a private field and is visible within the com.google.firebase.crashlytics package. @mrichards Can we move this test into src/main/java/com/google/firebase/crashlytics and access the field directly?

As for breadcrumbSource, can we make it public and annotation with @VisibleForTesting? (could actually be used with core above as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vkryachko Please take a look at the updated implementation. I moved CrashlyticsTest to the crashlytics package, because making core public in FirebaseCrashlytics makes it visible in the IDE's autocomplete for customers, even when @VisibleForTesting was used.

LMK if this is consistent with your suggestion.

Copy link
Member

@vkryachko vkryachko left a comment

Choose a reason for hiding this comment

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

LGTM with minor nits

@@ -156,7 +157,8 @@ public Void call() throws Exception {
return new FirebaseCrashlytics(core);
}

private final CrashlyticsCore core;
// package-private for smoke tests
final CrashlyticsCore core;
Copy link
Member

Choose a reason for hiding this comment

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

Could you still add @VisibleForTesting?

private final IdManager idManager;
private final BreadcrumbSource breadcrumbSource;

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
Copy link
Member

Choose a reason for hiding this comment

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

I think otherwise = Private is the default, so no need to explicitly specify

@mrichards mrichards merged commit a78f6bd into master Jul 9, 2021
@mrichards mrichards deleted the crashlytics-smoke-tests branch July 9, 2021 18:53
@google-oss-bot
Copy link
Contributor

@mrichards: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
device-check-changed 2f1569a link /test device-check-changed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants