Skip to content

Add tests to ensure that FieldValue has no cyclic references #3869

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 5 commits into from
Oct 1, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

Addresses #3862

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2020

⚠️ No Changeset found

Latest commit: 1e52f50

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 30, 2020

Binary Size Report

Affected SDKs

  • @firebase/analytics

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 18.6 kB ? (?)
    main ? 23.8 kB ? (?)
    module ? 23.3 kB ? (?)
  • @firebase/app

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 11.1 kB ? (?)
    esm2017 ? 9.46 kB ? (?)
    lite ? 9.11 kB ? (?)
    lite-esm2017 ? 7.75 kB ? (?)
    main ? 10.2 kB ? (?)
    module ? 11.0 kB ? (?)
    react-native ? 9.87 kB ? (?)
  • @firebase/auth

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 177 kB ? (?)
    main ? 177 kB ? (?)
    module ? 177 kB ? (?)
  • @firebase/component

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 5.30 kB ? (?)
    esm2017 ? 3.98 kB ? (?)
    main ? 5.30 kB ? (?)
    module ? 5.18 kB ? (?)
  • @firebase/database

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 270 kB ? (?)
    esm2017 ? 236 kB ? (?)
    main ? 271 kB ? (?)
    module ? 269 kB ? (?)
  • @firebase/firestore

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 249 kB ? (?)
    esm2017 ? 197 kB ? (?)
    main ? 484 kB ? (?)
    module ? 247 kB ? (?)
    react-native ? 197 kB ? (?)
  • @firebase/firestore/exp

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 189 kB ? (?)
    main ? 477 kB ? (?)
    module ? 189 kB ? (?)
    react-native ? 189 kB ? (?)
  • @firebase/firestore/lite

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 63.4 kB ? (?)
    main ? 140 kB ? (?)
    module ? 63.4 kB ? (?)
    react-native ? 63.6 kB ? (?)
  • @firebase/firestore/memory

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 187 kB ? (?)
    esm2017 ? 147 kB ? (?)
    main ? 357 kB ? (?)
    module ? 185 kB ? (?)
    react-native ? 147 kB ? (?)
  • @firebase/functions

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 10.0 kB ? (?)
    esm2017 ? 7.59 kB ? (?)
    main ? 10.2 kB ? (?)
    module ? 9.77 kB ? (?)
  • @firebase/installations

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 16.5 kB ? (?)
    main ? 22.1 kB ? (?)
    module ? 21.5 kB ? (?)
  • @firebase/logger

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 3.25 kB ? (?)
    main ? 5.14 kB ? (?)
    module ? 4.83 kB ? (?)
  • @firebase/messaging

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 25.9 kB ? (?)
    main ? 34.7 kB ? (?)
    module ? 34.2 kB ? (?)
  • @firebase/performance

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 27.4 kB ? (?)
    esm2017 ? 25.4 kB ? (?)
    main ? 27.4 kB ? (?)
    module ? 27.1 kB ? (?)
  • @firebase/polyfill

    Type Base (34c8693) Head (ceb1608) Diff
    main ? 775 B ? (?)
    module ? 705 B ? (?)
  • @firebase/remote-config

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 22.8 kB ? (?)
    esm2017 ? 17.4 kB ? (?)
    main ? 22.8 kB ? (?)
    module ? 22.4 kB ? (?)
  • @firebase/rules-unit-testing

    Type Base (34c8693) Head (ceb1608) Diff
    main ? 7.28 kB ? (?)
  • @firebase/storage

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 54.9 kB ? (?)
    main ? 61.4 kB ? (?)
    module ? 61.1 kB ? (?)
  • @firebase/testing

    Type Base (34c8693) Head (ceb1608) Diff
    main ? 6.35 kB ? (?)
  • @firebase/util

    Type Base (34c8693) Head (ceb1608) Diff
    browser ? 21.1 kB ? (?)
    esm2017 ? 18.8 kB ? (?)
    main ? 21.2 kB ? (?)
    module ? 20.1 kB ? (?)
  • @firebase/webchannel-wrapper

    Type Base (34c8693) Head (ceb1608) Diff
    esm2017 ? 39.4 kB ? (?)
    main ? 41.0 kB ? (?)
    module ? 40.6 kB ? (?)
  • firebase

    Click to show 15 binary size changes.
    Type Base (34c8693) Head (ceb1608) Diff
    firebase-analytics.js ? 35.9 kB ? (?)
    firebase-app.js ? 20.2 kB ? (?)
    firebase-auth.js ? 174 kB ? (?)
    firebase-database.js ? 190 kB ? (?)
    firebase-firestore.js ? 287 kB ? (?)
    firebase-firestore.memory.js ? 227 kB ? (?)
    firebase-functions.js ? 10.1 kB ? (?)
    firebase-installations.js ? 19.2 kB ? (?)
    firebase-messaging.js ? 41.0 kB ? (?)
    firebase-performance-standalone.es2017.js ? 71.3 kB ? (?)
    firebase-performance-standalone.js ? 48.0 kB ? (?)
    firebase-performance.js ? 38.4 kB ? (?)
    firebase-remote-config.js ? 37.1 kB ? (?)
    firebase-storage.js ? 39.9 kB ? (?)
    firebase.js ? 831 kB ? (?)

Test Logs

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 30, 2020

Size Analysis Report

Affected Products

No changes between base commit (34c8693) and head commit (ceb1608).

Test Logs

JSON.stringify(FieldValue.arrayUnion(2));
JSON.stringify(FieldValue.arrayRemove(3));
} catch (e) {
expect.fail('Unexpected error: ' + e.message);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just let the exception propagate to fail the test instead of catching it explicitly? As it is, the fail message will not indicate which call threw an exception but if the exception just propagates then I assume that a full stack trace would be provided, indicating which call failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrote the test this way to ensure that it is obvious that I am only verifying that the API calls do not throw. Let me do this with a comment instead and remove the try/catch block.

@schmidt-sebastian schmidt-sebastian merged commit 332c36c into master Oct 1, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/cyclictest branch October 1, 2020 18:55
@firebase firebase locked and limited conversation to collaborators Nov 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants