Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not run PR GQL tests on main branch #1347

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/performance-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
run_tests:
if: github.event.deployment_status.state == 'success'
if: github.event.deployment_status.state == 'success' && github.event_name == 'pull_request'
name: Run tests
runs-on: ubuntu-latest
steps:
Expand All @@ -22,21 +22,21 @@ jobs:
image: grafana/k6:latest
options: -v ${{ github.workspace }}:/root
run: |
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV &&
echo "SUMMARY=$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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeMetadata.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubeObservations.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/DataCubePreview.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV &&
echo "SUMMARY=${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 ROOT_PATH=/root/ --env CHECK_TIMING=true - </root/k6/performance-tests/graphql/PossibleFilters.js)" >> $GITHUB_ENV
- name: GQL performance tests ✅
if: ${{ env.SUMMARY == '' }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions k6/performance-tests/generate-github-actions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const generatePRTests = () => {
)
)
)
.map((command) => `echo "SUMMARY=$SUMMARY$(${command})" >> $GITHUB_ENV`)
.map((command) => `echo "SUMMARY=\${SUMMARY}$(${command})" >> $GITHUB_ENV`)
.join(" &&\n ");
const file = `name: GraphQL performance tests (PR)

Expand All @@ -88,7 +88,7 @@ env:

jobs:
run_tests:
if: github.event.deployment_status.state == 'success'
if: github.event.deployment_status.state == 'success' && github.event_name == 'pull_request'
name: Run tests
runs-on: ubuntu-latest
steps:
Expand Down
Loading