From 4aca082621f72c1f2b6aa1eab0435b6df782e0c3 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 24 Aug 2021 12:13:25 +0200 Subject: [PATCH] Add new manual pipeline step --- bin/run-cypress-parallel.sh | 21 +++++++++++++++++++++ bitbucket-pipelines.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 bin/run-cypress-parallel.sh diff --git a/bin/run-cypress-parallel.sh b/bin/run-cypress-parallel.sh new file mode 100755 index 00000000..bcfa0002 --- /dev/null +++ b/bin/run-cypress-parallel.sh @@ -0,0 +1,21 @@ +#!/bin/bash +if [[ -z "${CYPRESS_API_URL+x}" ]]; then + echo "CYPRESS_API_URL not set" + exit 1 +fi +if [[ -z "${CYPRESS_RECORD_KEY+x}" ]]; then + echo "CYPRESS_RECORD_KEY not set" + exit 2 +fi +if [[ -z "${BITBUCKET_BUILD_NUMBER+x}" ]]; then + echo "BITBUCKET_BUILD_NUMBER not set" + exit 2 +fi + +run_test_instance() { + cd client + build_id="myskillbox-run-${BITBUCKET_BUILD_NUMBER}" + npx cy2 run --parallel --record --config-file cypress.frontend.json --ci-build-id ${build_id} +} + +run_test_instance diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 10160425..eabe5e20 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -80,6 +80,23 @@ aliases: - sleep 30 - curl http://localhost:8080/beta-login - npm run --prefix client test:cypress:frontend +- &frontend-test-parallel + name: run cypress frontend tests + caches: + - node + - clientmodules + - npm + - cypress + artifacts: + - client/cypress/**/*.png + - client/cypress/**/*.mp4 + script: + - npm ci --prefix client + - npm run "install:cypress" --prefix client + - npm run dev --prefix client 2>&1 > /dev/null & + - sleep 30 + - curl http://localhost:8080/beta-login + - source bin/run-cypress-parallel.sh - &jest-test name: run jest tests caches: @@ -165,3 +182,12 @@ pipelines: - step: *jest-test - parallel: - step: *deploy-prod-manual + + cypress-parallel: + - parallel: + - step: *frontend-test-parallel + - step: *frontend-test-parallel + - step: *frontend-test-parallel + - step: *frontend-test-parallel + - step: *frontend-test-parallel + - step: *frontend-test-parallel