0

We are running a larger scale project on Firebase and have already invested in unit tests. Now, we are also using the experimental shell to run integration tests against a testing environment and database. We would very much like to invoke functions via bash and shell script instead of opening the experimental shell, requiring our testdata and invoking each function manually. We tried reverse-engineering the firebase tools for that matter but this seems to be overkill. Any idea how we might be able to test-run all our functions in series?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
reinhardt
  • 351
  • 5
  • 14
  • You can run the firebase CLI from a script and send it JS to run via stdin. – Doug Stevenson Feb 16 '18 at 19:37
  • https://firebase.googleblog.com/2017/09/testing-functions-locally-with-cloud.html – Doug Stevenson Feb 16 '18 at 19:38
  • Cool, I completely overlooked that last part. How would you go about doing a full fledged integration test this way? I am now resetting our testing db before running all functions. But what about after? How can we check that all functions completed successfully? – reinhardt Feb 17 '18 at 10:23
  • Isn't there a way to do this without the shell? The way I see it we can't use promises this way and even comments through stdin are evaluated. – reinhardt Feb 17 '18 at 11:04
  • Another question: How do we exit after the functions are done? `process.exit()` will lead to zombie processes. – reinhardt Feb 17 '18 at 11:07
  • Please file a bug for that. https://firebase.google.com/support/contact/bugs-features/ – Doug Stevenson Feb 18 '18 at 17:32
  • Ok, thanks, but what about the other question: Can one circumvent the shell and still get programmatic access to the the virtual function process? So that we can easily do promises etc.? – reinhardt Feb 19 '18 at 08:23
  • For things that are not documented like this, please file a feature request. https://firebase.google.com/support/contact/bugs-features/ – Doug Stevenson Feb 19 '18 at 17:12

0 Answers0