-
Notifications
You must be signed in to change notification settings - Fork 374
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
test(rtdb-limit-child-nodes): use emulator for testing #482
Conversation
I think |
Hey, thanks for the update, @rosariopfernandes. Could you confirm that this is the case, @jhuleatt? I've created an issue here for this issue either way. |
Apologies for the slow response here, this slipped past me. To give some clarity on the extensions emualtor:
Hopefully this helps - if the ext:dev:emulator:* commands still aren't working, this is likely a regression and I will look into this further |
Hey @joehan, thanks for the update! I was indeed using the wrong command (i.e. firebase ext:dev:emulators:start ./extension.yaml --test-params=emulator-params.env --project=extensions-testing from the I also tried without the path in the command: firebase ext:dev:emulators:start --test-params=emulator-params.env --project=extensions-testing Which gave me the following error: Error: HTTP Error: 403, Invalid Firebase database name My LOCATION=europe-west2
MAX_COUNT=2
NODE_PATH=test_path |
@russellwheatley @joehan it looks like the emulator doesn't support the firebase ext:dev:emulators:start --test-params=emulator-params.env --project=jeff-test-699d3 I'll commit my extension.yaml changes, since we probably don't want to block this on CLI updates. The CLI doesn't seem to have full support for the new syntax - a similar bug recently bit me on another PR #486 (comment) Googlers, I've filed internal issue number |
This comment has been minimized.
This comment has been minimized.
@@ -55,7 +55,7 @@ resources: | |||
runtime: nodejs10 | |||
eventTrigger: | |||
eventType: providers/google.firebase.database/eventTypes/ref.create | |||
resource: projects/_/instances/${param:DATABASE_INSTANCE}/refs/${param:NODE_PATH}/{messageid} | |||
resource: projects/_/instances/${DATABASE_INSTANCE}/refs/${NODE_PATH}/{messageid} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@russellwheatley @joehan this is what I had to change to get it to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that makes a lot of sense! I'll take on the CLI bug this week to unblock the change
This comment has been minimized.
This comment has been minimized.
Update: I can visit http://localhost:4000/ to see the emulator UI and manually add data to the emulated database. However, when the function runs, I seem to run into something like firebase/firebase-functions#726, so I can't get it to fully work. Here's the error (firebase-tools
@joehan is it possible the extensions emulators use a different codepath that needs a fix similar to the one that fixed firebase/firebase-functions#726 ? |
|
||
const configPath = cleanPath(config.nodePath); | ||
|
||
export const rtdblimit = functions.database.ref(`${configPath}/{nodeId}`).onCreate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change back to functions.handler
. We'd like to make sure the extensions emulator commands work correctly
The bug blocking this was fixed in firebase-tools 8.16.0 |
Thanks for the update, @jhuleatt. I'll get this revised 👍 |
Hey @jhuleatt @joehan, I'm unable to get this working. My setup:
When I add data via the console UI, I get the same error as mentioned above:
The exact moment it happens is when |
Issues raised with |
going to close this for now as it's pretty old, would be easier to add tests in a new PR i think. |
WIP
notes
path
property on Reference is deprecated so it has been removed.