From 45371608b161a823ab7c65bc6c2a9a0b1cb61318 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 14 Dec 2023 09:44:44 +0100 Subject: [PATCH] feat: Set up initial GraphQL performance tests --- .github/workflows/performance-tests.yml | 17 +++++++++ .../generate-github-action.js | 37 +++++++++++++++++++ k6/performance-tests/graphql/metadata.js | 19 +++------- package.json | 3 +- 4 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/performance-tests.yml create mode 100644 k6/performance-tests/generate-github-action.js diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml new file mode 100644 index 000000000..81ae748ad --- /dev/null +++ b/.github/workflows/performance-tests.yml @@ -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/ - { + 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} -