Metis Test Suite
This GitHub Action allows you to create a new test in Metis, and comment on a pull request with the results of the test. we use your pr-name as your test name.
- A Metis account with a valid API key. https://docs.metisdata.io/metis/getting-started/what-is-metis
- Metis SDK installed on your project. https://docs.metisdata.io/metis/sdk-integration/general
metis_api_key
: The Metis API key to use for creating the testgithub_token
: The GitHub token to use for commenting on the pull request
Add the following code to your GitHub Actions workflow file:
- name: Metis Test
id: tag_pr
uses: metis-data/test-queries-[email protected]
with:
metis_api_key: ${{ secrets.METIS_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Inject tag_pr in your env for your sdk usage
- name: E2E Test that check sql queries on real database
.
.
env:
METIS_TAG_PR: ${{ steps.tag_pr.outputs.pr_tag }}
.
.
name: E2E-TEST-EXAMPLE
on:
# Run workflow every 6 hours
schedule:
- cron: '0 */6 * * *'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: set TAG PR Value step
id: tag_pr
uses: metis-data/test-queries-[email protected]
with:
metis_api_key: ${{ secrets.METIS_API_KEY}}
github_token: ${{ secrets.GITHUB_TOKEN}}
- name: checkout
uses: actions/[email protected]
- name: setup-node
uses: actions/setup-[email protected]
with:
node-version: 18.x
- name: test
env:
METIS_TAG_PR: ${{ steps.tag_pr.outputs.pr_tag }}
METIS_API_KEY: ${{ secrets.METIS_API_KEY}} #Optional
DATABASE_URL: ${{ secrets.METIS_E2E_DB_CONNECTION }} #Optional
# Run your e2e test
run: npm ci && npm run test-sql-queries
Last modified 2mo ago