react-native-firebase
react-native-firebase copied to clipboard
test(database, e2e): remove workaround for emulator rules
Description
It seems that the latest version of the Emulator loads the database rules correctly, which means we can get rid of the workarounds.
The e2e tests run successfully after updating the helpers.js file.
Related issues
https://github.com/invertase/react-native-firebase/issues/5876
Release Summary
Remove workarounds in e2e for database Emulator
Checklist
- I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [X] Yes
- My change supports the following platforms;
- [ ]
Android - [ ]
iOS
- [ ]
- My change includes tests;
- [X]
e2etests added or updated inpackages/\*\*/e2e - [ ]
jesttests added or updated inpackages/\*\*/__tests__
- [X]
- [ ] I have updated TypeScript types that are affected by my change.
- This is a breaking change;
- [ ] Yes
- [X] No
Test Plan
Think react-native-firebase is great? Please consider supporting the project with any of the below:
- đ Star this repo on GitHub âī¸
- đ Follow
React Native FirebaseandInvertaseon Twitter
đĨ
The latest updates on your projects. Learn more about Vercel for Git âī¸
| Name | Status | Preview | Updated |
|---|---|---|---|
| react-native-firebase | â Ready (Inspect) | Visit Preview | Sep 17, 2022 at 4:06PM (UTC) |
1 Ignored Deployment
| Name | Status | Preview | Updated |
|---|---|---|---|
| react-native-firebase-next | âŦī¸ Ignored (Inspect) | Sep 17, 2022 at 4:06PM (UTC) |
Codecov Report
Merging #6498 (1436ddb) into main (1fe3570) will decrease coverage by
46.43%. The diff coverage isn/a.
:exclamation: Current head 1436ddb differs from pull request most recent head 3e11007. Consider uploading reports for the commit 3e11007 to get more accurate results
@@ Coverage Diff @@
## main #6498 +/- ##
===========================================
- Coverage 72.25% 25.82% -46.42%
===========================================
Files 109 97 -12
Lines 4662 4296 -366
Branches 1051 1051
===========================================
- Hits 3368 1109 -2259
- Misses 1214 2585 +1371
- Partials 80 602 +522
Thanks for your speedy response @mikehardy. I addressed everything you mentioned in your comments and sorted out the CLA with my correct signed account (I had it done in the past so not sure what happen there).
In my local the e2e runs smoothly:

Let's see if the pipeline likes that too!
Oh my! Just saw this one was still sitting around, apologies. Still getting back up to speed since summer travels. I just squashed the three commits to one, rebased it against current main, and re-pushed it so CI will hopefully clear Then we can get this in, it's a nice cleanup
Hmm - not sure what the explanation is, but currently failing every time on iOS at least (android is having unrelated issues) in CI with
database().ref().on()
â throws if event type is invalid
â throws if callback is not a function
â throws if cancel callback is not a function
â throws if context is not an object
â should callback with an initial value
- should callback multiple times when the value changes
16:56:14.777 detox[17936] WARN: at e2e/init.js:41:15
â ī¸ A test failed:
16:56:14.778 detox[17936] WARN: at e2e/init.js:42:15
ī¸ -> should cancel when something goes wrong
16:56:14.779 detox[17936] WARN: at e2e/init.js:49:13
ī¸ -> Retrying in 5 seconds ... (1)
16:56:24.799 detox[17936] WARN: at e2e/init.js:46:15
đ´ Retry #1 failed...
16:56:24.800 detox[17936] WARN: at e2e/init.js:49:13
ī¸ -> Retrying in 10 seconds ... (2)
16:56:39.803 detox[17936] WARN: at e2e/init.js:46:15
đ´ Retry #2 failed...
16:56:39.804 detox[17936] WARN: at e2e/init.js:49:13
ī¸ -> Retrying in 15 seconds ... (3)
16:56:59.808 detox[17936] WARN: at e2e/init.js:46:15
đ´ Retry #3 failed...
16:56:59.809 detox[17936] WARN: at e2e/init.js:49:13
ī¸ -> Retrying in 20 seconds ... (4)
1) should cancel when something goes wrong
319 passing (6m)
23 pending
1 failing
1) database().ref().on()
should cancel when something goes wrong:
Error: Spy was not called within timeout period.
at Timeout._onTimeout (node_modules/@react-native-firebase/private-tests-helpers/lib/index.js:3:824)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
No worries at all! Between travelling and work I only had time to have a look at this now.
I retested the changes I made with a fresh clone from main and I'm getting the same failing test in my local as the CI. It looks like we still need to keep the workaround for now after all. âšī¸
Well, at least we are not crazy since we have reproducible results. Or with only a sample size of 2 perhaps it is still sunspots or something and we're just falling prey to confirmation bias. But I'll trust the result - I guess we still need the workaround
It was a wonderful thought though, I do love purging workarounds - thanks a bunch for the attempt. Cheers