diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index 3f5d58e59..c2eadd8c9 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -1,4 +1,4 @@ -name: GraphQL performance tests +name: GraphQL performance tests (auto) on: workflow_dispatch: diff --git a/k6/performance-tests/generate-github-action.mjs b/k6/performance-tests/generate-github-actions.mjs similarity index 72% rename from k6/performance-tests/generate-github-action.mjs rename to k6/performance-tests/generate-github-actions.mjs index cae321a0a..e7fe3c5da 100644 --- a/k6/performance-tests/generate-github-action.mjs +++ b/k6/performance-tests/generate-github-actions.mjs @@ -10,16 +10,26 @@ const queries = [ "DataCubePreview", "PossibleFilters", ]; + const commands = envs .flatMap((env) => queries.flatMap((query) => - cubes.map((cube) => getRunCommand(env, query, cube)) + cubes.map((cube) => + getRunCommand( + env, + query, + cube, + `https://${ + env === "prod" ? "" : `${env}.` + }visualize.admin.ch/api/graphql` + ) + ) ) ) .join(" &&\n "); const generate = () => { - const file = `name: GraphQL performance tests + const file = `name: GraphQL performance tests (auto) on: workflow_dispatch: @@ -51,12 +61,6 @@ jobs: generate(); -function getRunCommand(env, query, cube) { - return `k6 run -o experimental-prometheus-rw --tag testid=${query} --env ENV=${env} --env ENDPOINT=${`https://${ - env === "prod" ? "" : `${env}.` - }visualize.admin.ch/api/graphql`} --env CUBE_IRI=${ - cube.iri - } --env CUBE_LABEL=${ - cube.label - } -