A Cloud Function to post Firebase Test Lab results to Slack
Largely borrowed from: https://github.com/firebase/functions-samples/tree/main/testlab-to-slack
- Clone or download this repo and open the
cloud-functions-slack
directory. - You must have the Firebase CLI installed. If you don't have it install it
with
npm install -g firebase-tools
and then configure it withfirebase login
. - Configure the CLI locally by using
firebase use --add
and select your project in the list. - Install Cloud Functions dependencies locally by running:
cd functions; npm install; cd -
- Set the following environment variables so that the function can authenticate with Slack and post to the correct room:
firebase functions:config:set slack.webhook_url="YOUR_SLACK_WEBHOOK_URL"
- Deploy your function using
firebase deploy --only functions
- Navigate to the Test Lab section of the Firebase Console and start a test.
- Once the test finishes running, view the functions logs for your project, and check that the test run status was logged.
TEST matrix-2pwpy02hkp9wc (created at 2022-09-26T00:25:58.392882Z): FINISHED. SUCCESS