-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set up initial GraphQL performance tests
- Loading branch information
1 parent
abd95a4
commit 4537160
Showing
4 changed files
with
62 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Performance tests | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
compile: | ||
name: Compile site assets | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: grafana/k6:latest | ||
options: -rm -e K6_PROMETHEUS_RW_USERNAME=${{ secrets.K6_PROMETHEUS_RW_USERNAME }} -e K6_PROMETHEUS_RW_PASSWORD=${{ secrets.K6_PROMETHEUS_RW_PASSWORD }} -e K6_PROMETHEUS_RW_SERVER_URL=${{ secrets.K6_PROMETHEUS_RW_SERVER_URL }} | ||
run: k6 run -o experimental-prometheus-rw --tag testid=StateAccounts_Office/4/ --env ENV=test --env CUBE=StateAccounts_Office/4/ - <k6/performance-tests/graphql/metadata.js && k6 run -o experimental-prometheus-rw --tag testid=StateAccounts_Office/4/ --env ENV=int --env CUBE=StateAccounts_Office/4/ - <k6/performance-tests/graphql/metadata.js && k6 run -o experimental-prometheus-rw --tag testid=StateAccounts_Office/4/ --env ENV=prod --env CUBE=StateAccounts_Office/4/ - <k6/performance-tests/graphql/metadata.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const fs = require("fs"); | ||
|
||
const envs = ["test", "int", "prod"]; | ||
const queries = ["metadata"]; | ||
const cubes = ["StateAccounts_Office/4/"]; | ||
|
||
const generate = () => { | ||
const file = `name: Performance tests | ||
on: workflow_dispatch | ||
jobs: | ||
compile: | ||
name: Compile site assets | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: grafana/k6:latest | ||
options: -rm -e K6_PROMETHEUS_RW_USERNAME=\${{ secrets.K6_PROMETHEUS_RW_USERNAME }} -e K6_PROMETHEUS_RW_PASSWORD=\${{ secrets.K6_PROMETHEUS_RW_PASSWORD }} -e K6_PROMETHEUS_RW_SERVER_URL=\${{ secrets.K6_PROMETHEUS_RW_SERVER_URL }} | ||
run: ${envs | ||
.map((env) => { | ||
return queries.map((query) => { | ||
return cubes.map((cube) => { | ||
return `k6 run -o experimental-prometheus-rw --tag testid=${cube} --env ENV=${env} --env CUBE=${cube} - <k6/performance-tests/graphql/${query}.js`; | ||
}); | ||
}); | ||
}) | ||
.join(" && ")}`; | ||
|
||
fs.writeFileSync("./.github/workflows/performance-tests.yml", file); | ||
}; | ||
|
||
generate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters