From 533fdbce437c977b4334499f77394b93d2048a4c Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 14 Dec 2023 12:39:04 +0100 Subject: [PATCH] refactor: Make the run commands more readable --- .github/workflows/performance-tests.yml | 20 ++++++++++++++++++- .../generate-github-action.js | 5 +++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index 375dd6ada..f840733be 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -14,4 +14,22 @@ jobs: with: image: grafana/k6:latest options: -v ${{ github.workspace }}:/root -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=DataCubeComponents --env ENV=test --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 - queries.flatMap((q) => cubes.map((c) => getRunCommand(e, q, c))) ) - .join(" && "); + .join(" &&\n "); const generate = () => { const file = `name: GraphQL performance tests @@ -39,7 +39,8 @@ jobs: with: image: grafana/k6:latest options: -v \${{ github.workspace }}:/root -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: ${commands}`; + run: | + ${commands}`; fs.writeFileSync("./.github/workflows/performance-tests.yml", file); };