Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E Tests parallel execution #2833

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: ‏As far as I get it, this action just provides a range for enumeration, right? Like you say 4 and it spits [1,2,3,4]

with:
n: 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have this 4 in some variable on top?
So we can change if needed, as it is used in 2 places

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: where does this number come from? Should it be the number of cores?

- name: Print result 🖨
run: echo '${{ steps.prepare.outputs.matrix }}'

test-e2e:
name: End to end tests
needs: [elixir-deps, npm-deps, npm-e2e-deps]
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 @@ -423,14 +439,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 }}
Comment on lines +445 to +446
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: ‏Where do those variables come out? Shouldn't be something like strategy.matrix... or prepare.output.matrix...?

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 @@ -21,6 +22,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
Loading