Skip to content

Commit 3448544

Browse files
add shards
1 parent fa50057 commit 3448544

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/full-test-suite.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ on:
2525
type: string
2626
required: false
2727
description: Dispatch id to update status (repo/sha)
28+
shards:
29+
type: integer
30+
required: false
31+
description: Number of shards to split tests into for parallel execution
32+
default: 1
2833
secrets:
2934
GH_REPOSITORY_ADMIN_TOKEN:
3035
description: 'Github repository admin token'
@@ -119,32 +124,40 @@ jobs:
119124
description: 'Start tests environment ${{ steps.variables.outputs.apiUrl }}'
120125

121126
run-e2e-test:
122-
name: Run E2E Tests on Venv
127+
name: Run E2E Tests on Venv (Shard ${{ matrix.shard }}/${{ inputs.shards }})
123128
needs: [ prepare-params ]
124129
if: |
125130
always() &&
126131
!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
shard: ${{ range(1, inputs.shards + 1) }}
127136
uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master
128137
with:
129138
server_url: ${{ needs.prepare-params.outputs.apiUrl }}
130139
portal_url: ${{ needs.prepare-params.outputs.portalUrl }}
131140
command: |
132-
FRAMEWORK="react" yarn run test:e2e:sanity
141+
FRAMEWORK="react" yarn run test:e2e:sanity --shard=${{ matrix.shard }}/${{ inputs.shards }}
133142
workflowName: "E2E Tests on Venv"
134143
runs_on: ubuntu-latest-4-cores
135144
secrets: inherit
136145

137146
run-api-test:
138-
name: Run API Tests on Venv
147+
name: Run API Tests on Venv (Shard ${{ matrix.shard }}/${{ inputs.shards }})
139148
needs: [ prepare-params ]
140149
if: |
141150
always() &&
142151
!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
152+
strategy:
153+
fail-fast: false
154+
matrix:
155+
shard: ${{ range(1, inputs.shards + 1) }}
143156
uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master
144157
with:
145158
server_url: ${{ needs.prepare-params.outputs.apiUrl }}
146159
portal_url: ${{ needs.prepare-params.outputs.portalUrl }}
147-
command: "yarn test:api"
160+
command: "yarn test:api --shard=${{ matrix.shard }}/${{ inputs.shards }}"
148161
workflowName: "API Tests on Venv"
149162
secrets: inherit
150163

@@ -183,7 +196,8 @@ jobs:
183196
if: |
184197
always() &&
185198
(needs.prepare-params.outputs.environmentId) &&
186-
contains(needs.*.result, 'success')
199+
!contains(needs.run-api-test.result, 'failure') &&
200+
!contains(needs.run-e2e-test.result, 'failure')
187201
uses: frontegg/workflows/.github/workflows/remove-single-venv.yaml@master
188202
with:
189203
venvId: ${{ needs.prepare-params.outputs.environmentId }}

0 commit comments

Comments
 (0)