Skip to content

Migrate testing to rules-unit-testing #3378

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 25 commits into from
Aug 13, 2020
Merged

Migrate testing to rules-unit-testing #3378

merged 25 commits into from
Aug 13, 2020

Conversation

samtstern
Copy link
Contributor

@samtstern samtstern commented Jul 9, 2020

Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:

Discussion

Googlers: see change rationale here

TODO:

Testing

  • Added unit tests
  • Tested locally with quickstart-testing although it was made difficult by the fact that file: deps with peerDependencies don't play nice.

API Changes

  • Rename @firebase/testing to @firebase/rules-unit-testing

@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2020

🦋 Changeset is good to go

Latest commit: 3b0c125

We got this.

This PR includes changesets to release 1 package
Name Type
@firebase/rules-unit-testing Major

Not sure what this means? Click here to learn what changesets are.

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

new Error('Expected request to fail, but it succeeded.')
);
},
(err: any) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now make sure the error is a FirebaseError with a message that contains PERMISSION_DENIED. This prevents connect failures from giving the illusion of security.

@samtstern samtstern requested review from yuchenshi and Feiyang1 July 9, 2020 15:20
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 9, 2020

Binary Size Report

Affected SDKs

  • @firebase/rules-unit-testing

    Type Base (2245ad7) Head (47d8e70) Diff
    main ? 7.24 kB ? (?)

Test Logs

@yuchenshi
Copy link
Member

One question: How would you update the old package once this PR gets merged? For example, if we'd like to add a deprecation notice or have the methods print out a warning, how would we track and review those changes?

@samtstern
Copy link
Contributor Author

@yuchenshi I believe that deprecation message is entirely managed by running npm deprecate on @firebase/testing ... it's not something we do here on GitHub (correct me if I am wrong @Feiyang1)

@yuchenshi
Copy link
Member

@yuchenshi I believe that deprecation message is entirely managed by running npm deprecate on @firebase/testing ... it's not something we do here on GitHub (correct me if I am wrong @Feiyang1)

What if we want to print a warning message when developers call the initializeAdminApp() method to notify them of the caveats and the upcoming change?

Also, although unlikely, what if we need to apply security patches? e.g. updating a dependency due to an open vulnerability report?

@samtstern
Copy link
Contributor Author

@yuchenshi I would be fine to do a copy instead of a fork, I just want to know if @Feiyang1 has any problem with "dead" code sitting around in packages/testing

@samtstern
Copy link
Contributor Author

@Feiyang1 can you weigh in on the copy vs fork thing? Would it be alright if we had @firebase/testing and @firebase/rules-unit-testing side by side for at least one release?

@samtstern samtstern marked this pull request as ready for review July 16, 2020 14:37
@Feiyang1
Copy link
Member

I'm fine with that. We can remove @firebase/testing in the repo when we feel comfortable.

@samtstern
Copy link
Contributor Author

@Feiyang1 after you approve this and #3556 I wil merge it into here and then merge this when the tests pass.

@samtstern samtstern requested a review from Feiyang1 August 6, 2020 19:21
@samtstern samtstern merged commit 980c7d5 into master Aug 13, 2020
@google-oss-bot google-oss-bot mentioned this pull request Aug 18, 2020
@firebase firebase locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants