[go: nahoru, domu]

Skip to content

Latest commit

 

History

History

testlab-to-slack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Post Test Lab Results to Slack channel

This sample demonstrates how to post to a Slack channel in response to the completion of a test matrix in Firebase Test Lab. The message will look like this:

example Slack message with Test Lab status

Setting up the sample

  1. Add an Incoming Webhook to your Slack channel and take note of the Webhook URL.

  2. Clone or download this repo and open this directory in a terminal:

    cd testlab-to-slack
  3. You must have the latest Firebase CLI installed. If you don't have it, install it with npm install -g firebase-tools and then sign in with firebase login.

  4. Configure the CLI locally by using firebase use --add and select your project in the list.

  5. Install Cloud Functions dependencies locally by running: cd functions; npm install; cd -

  6. 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 and test

This sample comes with a web-based UI for testing the function. To test it out:

  1. Deploy your function using firebase deploy --only functions
  2. Navigate to the Test Lab section of the Firebase Console and start a test.
  3. Once the test finishes running, check your Slack channel and view the new post!