Skip to content

Commit

Permalink
test e2e cypress parallel split
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Jul 30, 2024
1 parent 54cb9ba commit 70aa966
Show file tree
Hide file tree
Showing 4 changed files with 4,028 additions and 262 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,26 @@ jobs:
if: steps.npm-e2e-cache.outputs.cache-hit != 'true'
run: cd test/e2e && npm install

prepare:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.prepare.outputs.matrix }}
steps:
- name: Create matrix ⊹
id: prepare
uses: bahmutov/gh-build-matrix@main
with:
n: 4
- name: Print result 🖨
run: echo '${{ steps.prepare.outputs.matrix }}'

test-e2e:
name: End to end tests
needs: [elixir-deps, npm-deps, npm-e2e-deps, api-bc-check]
needs: [elixir-deps, npm-deps, npm-e2e-deps, prepare]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
env:
MIX_ENV: dev
steps:
Expand Down Expand Up @@ -415,14 +431,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Give executable permissions to photofinish
run: chmod +x $(whereis photofinish | cut -d" " -f2)
- name: Cypress run
- name: Parallel cypress
uses: cypress-io/github-action@v6
env:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
DEBUG: cypress-split
cypress_video: false
cypress_db_host: postgres
cypress_db_port: 5432
cypress_photofinish_binary: $(whereis photofinish | cut -d" " -f2)
with:
n: 4
working-directory: test/e2e
wait-on-timeout: 30
config: baseUrl=http://localhost:4000
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { defineConfig } = require('cypress');
const cypressSplit = require('cypress-split');

module.exports = defineConfig({
viewportWidth: 1366,
Expand All @@ -20,6 +21,7 @@ module.exports = defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
cypressSplit(on, config);
return require('./cypress/plugins/index.js')(on, config);
},
testIsolation: false,
Expand Down
Loading

0 comments on commit 70aa966

Please sign in to comment.