Skip to content

GraphQL performance tests (PR) #1448

GraphQL performance tests (PR)

GraphQL performance tests (PR) #1448

# GENERATED FILE, DO NOT EDIT MANUALLY - use yarn run github:codegen instead
name: GraphQL performance tests (PR)
on: [deployment_status]
env:
SUMMARY: ''
jobs:
run_tests:
if: github.event.deployment_status.state == 'success'
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Send an HTTP request to start up the server
run: |
curl -s '${{ github.event.deployment_status.target_url }}/api/graphql' -X 'POST' -H 'Content-Type: application/json' -d '{"operationName":"DataCubeObservations","variables":{"locale":"en","sourceType":"sparql","sourceUrl":"https://lindas.admin.ch/query","cubeFilter":{"iri":"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9","filters":{"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton":{"type":"single","value":"https://ld.admin.ch/canton/1"}}}},"query":"query DataCubeObservations($sourceType: String!, $sourceUrl: String!, $locale: String!, $cubeFilter: DataCubeObservationFilter!) { dataCubeObservations(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale, cubeFilter: $cubeFilter) }"}' > /dev/null
- name: Download, unzip and install k6 binary
run: |
wget https://github.com/grafana/k6/releases/download/v0.49.0/k6-v0.49.0-linux-amd64.tar.gz
tar -xzf k6-v0.49.0-linux-amd64.tar.gz
sudo cp k6-v0.49.0-linux-amd64/k6 /usr/local/bin/k6
export PATH=$PATH:/usr/local/bin
- name: Run k6 test (iteration 1)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeComponents --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 2)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeComponents --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3 --env CUBE_LABEL=NFI/2023-3 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 3)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeComponents --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/elcom/electricityprice --env CUBE_LABEL=Elcom --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 4)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeMetadata --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 5)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeMetadata --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3 --env CUBE_LABEL=NFI/2023-3 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 6)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeMetadata --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/elcom/electricityprice --env CUBE_LABEL=Elcom --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 7)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeObservations --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 8)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeObservations --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3 --env CUBE_LABEL=NFI/2023-3 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 9)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeObservations --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/elcom/electricityprice --env CUBE_LABEL=Elcom --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 10)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubePreview --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 11)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubePreview --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3 --env CUBE_LABEL=NFI/2023-3 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 12)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubePreview --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/elcom/electricityprice --env CUBE_LABEL=Elcom --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 13)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=PossibleFilters --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 14)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=PossibleFilters --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3 --env CUBE_LABEL=NFI/2023-3 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV
- name: Run k6 test (iteration 15)
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=PossibleFilters --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/elcom/electricityprice --env CUBE_LABEL=Elcom --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV
- name: GQL performance tests ❌
if: ${{ env.SUMMARY != '' }}
run: |
curl --request POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' --data '{
"context": "GQL performance tests",
"state": "failure",
"description": "${{ env.SUMMARY }}"
}'