firebase-functions-test icon indicating copy to clipboard operation
firebase-functions-test copied to clipboard

FIRESTORE_EMULATORS_HOST's host ignored in clearFirestoreData

Open shackijj opened this issue 2 years ago • 3 comments

https://github.com/firebase/firebase-functions-test/blob/c1dd82b84f5fe4126ca666577a04a7d72e96f2fc/src/providers/firestore.ts#L275

'localhost' value is hardcoded. Thanks makes it impossibe to run emulators on another host.

I encountered this problem when trying to run tests in Dockerized environment.

shackijj avatar Feb 25 '23 19:02 shackijj

Because of this clearFirestoreData is also failing with node 18 with ECONNREFUSED ::1:8080 error event though FIRESTORE_EMULATORS_HOST=127.0.0.1:8080 env variable is defined.

diginikkari avatar May 25 '23 09:05 diginikkari

I notice that firebase-functions-test IS checking for env variable FIRESTORE_EMULATOR_HOST (as opposed to OP's plural FIRESTORE_EMULATORS_HOST)

charneykaye avatar May 29 '23 21:05 charneykaye

@shackijj 's PR would be a good fix, but it hasn't been merged in a long time.

As a workaround, I set my host to "0.0.0.0" in firebase.json

    "firestore": {
      "host": "0.0.0.0",
    },

dan-wu-open avatar Apr 15 '24 01:04 dan-wu-open

#184 would resolve this

CorieW avatar Dec 20 '24 16:12 CorieW