Skip to content

Commit

Permalink
build: add Cypress parallelization with obfuscated record key (#12534)
Browse files Browse the repository at this point in the history
  • Loading branch information
robdiciuccio authored Jan 15, 2021
1 parent fc5e311 commit b1fcd61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/bashlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ cypress-run() {
export TERM="xterm"

say "::group::Run Cypress for [$page]"
if [[ -z $CYPRESS_RECORD_KEY ]]; then
if [[ -z $CYPRESS_KEY ]]; then
$cypress --spec "cypress/integration/$page" --browser "$browser"
else
export CYPRESS_RECORD_KEY=`echo $CYPRESS_KEY | base64 --decode`
# additional flags for Cypress dashboard recording
$cypress --spec "cypress/integration/$page" --browser "$browser" \
--record --group "$group" --tag "${GITHUB_REPOSITORY},${GITHUB_EVENT_NAME}" \
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/superset-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ on:
pull_request:

jobs:
Cypress:
cypress-matrix:
runs-on: ubuntu-18.04
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
containers: [1, 2, 3]
browser: ["chrome"]
env:
FLASK_ENV: development
Expand Down Expand Up @@ -87,7 +93,7 @@ jobs:
uses: ./.github/actions/cached-dependencies
env:
CYPRESS_BROWSER: ${{ matrix.browser }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_KEY: YjljODE2MzAtODcwOC00NTA3LWE4NmMtMTU3YmFmMjIzOTRhCg==
with:
run: cypress-run-all
- name: Upload Artifacts
Expand All @@ -96,3 +102,12 @@ jobs:
with:
name: screenshots
path: ${{ github.workspace }}/superset-frontend/cypress-base/cypress/screenshots
Cypress:
if: ${{ always() }}
name: Cypress (chrome)
runs-on: ubuntu-18.04
needs: cypress-matrix
steps:
- name: Check build matrix status
if: ${{ needs.cypress-matrix.result != 'success' }}
run: exit 1

0 comments on commit b1fcd61

Please sign in to comment.