firebase / firebase/firebase-tools

Check for readyness

Open
#5,009 3 comments 0 reactions 0 assignees View on GitHub
emulator-suite type: question
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

For CI we want to run the emulator suite in a docker service container (github actions). We need to able to check from the main script if the emulator is "ready". That means a couple of things:

1. The emulator container will start with an empty folder. We then wait in our custom "firebase-tools" container for the `firebase.json` to show up.
2. Once the `firebase.json` has shown up (because the main github action thread ran "checkout") we extract the location of the functions `package.json` and wait for it to show up.
3. Once the functions `package.json` has shown up, we can finally start the emulators, as they would crash if the functions `package.json` is not present (btw: it suffices to put in `{}` to this `package.json` so the check is pretty pointless...). [Here is the script for step 1. - 3.](https://github.com/brandturbo/firebase-tools-docker/blob/05300f69264c8679919a035c99b1738929f7d488/start.sh) The functions `package.json` shows up once we have run our `build` step.
4. In the main github action thread we now have to wait for the emulators to actually have loaded ALL FUNCTIONS. <--- **This I do not know how to do! Currently I use `waitFor localhost:4000` which returns too early!**
5. We can run our test suite.

Is there something like `http://localhost:4000/functions/health` or so?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.