From d651a362e38490f1f9b9582ff73f18081b1b33b1 Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Tue, 13 Dec 2022 10:46:41 +0100 Subject: [PATCH 1/3] Initial currents.dev integration --- bitbucket-pipelines.yml | 74 ++++++++++++++++++++++++++++------------- cypress.config.js | 1 + package.json | 3 +- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index c24b586f..73582a08 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,8 +1,57 @@ # this test is based on the docker image described in env/bitbucket/Dockerfile image: iterativ/vbv-lernwelt-bitbucket + +## job definition for running Cypress tests in parallel +e2e: &e2e + name: Cypress test worker + max-time: 45 + services: + - postgres + caches: + - node + - clientnode + - vbvpip + - cypress + script: + - export IT_SERVE_VUE=false + - export IT_ALLOW_LOCAL_LOGIN=true + - source ./env/bitbucket/prepare_for_test.sh + - source vbvvenv/bin/activate + - ./prepare_server_cypress.sh --start-background + - npm run cypress:ci + artifacts: + - cypress/**/*.png + - cypress/**/*.mp4 + pipelines: default: + - step: + name: install cypress dependencies + services: + - postgres + caches: + - node + - clientnode + - vbvpip + - cypress + script: + - export IT_SERVE_VUE=false + - export IT_ALLOW_LOCAL_LOGIN=true + - source ./env/bitbucket/prepare_for_test.sh + - npm install + - npm run build + - python -m venv vbvvenv + - source vbvvenv/bin/activate + - pip install -r server/requirements/requirements-dev.txt - parallel: + - step: + <<: *e2e + - step: + <<: *e2e + - step: + <<: *e2e + - step: + <<: *e2e - step: name: python tests max-time: 15 @@ -55,30 +104,7 @@ pipelines: - npm run prettier:check - npm run lint - npm run typecheck - - step: - name: cypress tests - max-time: 45 - services: - - postgres - artifacts: - - cypress/**/*.png - - cypress/**/*.mp4 - caches: - - node - - clientnode - - vbvpip - - cypress - script: - - export IT_SERVE_VUE=false - - export IT_ALLOW_LOCAL_LOGIN=true - - source ./env/bitbucket/prepare_for_test.sh - - npm install - - npm run build - - python -m venv vbvvenv - - source vbvvenv/bin/activate - - pip install -r server/requirements/requirements-dev.txt - - ./prepare_server_cypress.sh --start-background - - npm run cypress:ci + tags: v202*: - step: diff --git a/cypress.config.js b/cypress.config.js index 81bc10c4..28999d16 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,6 +1,7 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ + projectId: 'RVEZS1', watchForFileChanges: false, video: false, viewportWidth: 1280, diff --git a/package.json b/package.json index 49b7d73e..e8f7cf5a 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind --prefix client", "test": "echo \"Error: no test specified\" && exit 1", "cypress:open": "cypress open", - "cypress:ci": "cypress run", + "cypress:ci": "currents run --parallel --record --key etzp5VXtJcSX8Z4H", "prettier": "npm run prettier --prefix client" }, "devDependencies": { + "@currents/cli": "^3.1.3", "cypress": "^10.6.0" }, "dependencies": { From 4ace7418323749ac36f9b15421e77c9c9192fffa Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Wed, 14 Dec 2022 16:35:11 +0100 Subject: [PATCH 2/3] Move currents.dev key to package.json --- bitbucket-pipelines.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 73582a08..f014dcc0 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -13,6 +13,7 @@ e2e: &e2e - vbvpip - cypress script: + - export CURRENTS_KEY=etzp5VXtJcSX8Z4H - export IT_SERVE_VUE=false - export IT_ALLOW_LOCAL_LOGIN=true - source ./env/bitbucket/prepare_for_test.sh diff --git a/package.json b/package.json index e8f7cf5a..6229e1a5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind --prefix client", "test": "echo \"Error: no test specified\" && exit 1", "cypress:open": "cypress open", - "cypress:ci": "currents run --parallel --record --key etzp5VXtJcSX8Z4H", + "cypress:ci": "currents run --parallel --record --key $CURRENTS_KEY", "prettier": "npm run prettier --prefix client" }, "devDependencies": { From a30d218e333606583367427967845b36faa2f55a Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Wed, 14 Dec 2022 16:51:21 +0100 Subject: [PATCH 3/3] Reduce E2E worker count --- bitbucket-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index f014dcc0..030aa1c7 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -45,10 +45,6 @@ pipelines: - source vbvvenv/bin/activate - pip install -r server/requirements/requirements-dev.txt - parallel: - - step: - <<: *e2e - - step: - <<: *e2e - step: <<: *e2e - step: