|
25 | 25 | type: string |
26 | 26 | required: false |
27 | 27 | 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 |
28 | 33 | secrets: |
29 | 34 | GH_REPOSITORY_ADMIN_TOKEN: |
30 | 35 | description: 'Github repository admin token' |
@@ -119,32 +124,40 @@ jobs: |
119 | 124 | description: 'Start tests environment ${{ steps.variables.outputs.apiUrl }}' |
120 | 125 |
|
121 | 126 | run-e2e-test: |
122 | | - name: Run E2E Tests on Venv |
| 127 | + name: Run E2E Tests on Venv (Shard ${{ matrix.shard }}/${{ inputs.shards }}) |
123 | 128 | needs: [ prepare-params ] |
124 | 129 | if: | |
125 | 130 | always() && |
126 | 131 | !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') |
| 132 | + strategy: |
| 133 | + fail-fast: false |
| 134 | + matrix: |
| 135 | + shard: ${{ range(1, inputs.shards + 1) }} |
127 | 136 | uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master |
128 | 137 | with: |
129 | 138 | server_url: ${{ needs.prepare-params.outputs.apiUrl }} |
130 | 139 | portal_url: ${{ needs.prepare-params.outputs.portalUrl }} |
131 | 140 | command: | |
132 | | - FRAMEWORK="react" yarn run test:e2e:sanity |
| 141 | + FRAMEWORK="react" yarn run test:e2e:sanity --shard=${{ matrix.shard }}/${{ inputs.shards }} |
133 | 142 | workflowName: "E2E Tests on Venv" |
134 | 143 | runs_on: ubuntu-latest-4-cores |
135 | 144 | secrets: inherit |
136 | 145 |
|
137 | 146 | run-api-test: |
138 | | - name: Run API Tests on Venv |
| 147 | + name: Run API Tests on Venv (Shard ${{ matrix.shard }}/${{ inputs.shards }}) |
139 | 148 | needs: [ prepare-params ] |
140 | 149 | if: | |
141 | 150 | always() && |
142 | 151 | !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') |
| 152 | + strategy: |
| 153 | + fail-fast: false |
| 154 | + matrix: |
| 155 | + shard: ${{ range(1, inputs.shards + 1) }} |
143 | 156 | uses: frontegg/e2e-system-tests/.github/workflows/execute-test-command.yaml@master |
144 | 157 | with: |
145 | 158 | server_url: ${{ needs.prepare-params.outputs.apiUrl }} |
146 | 159 | portal_url: ${{ needs.prepare-params.outputs.portalUrl }} |
147 | | - command: "yarn test:api" |
| 160 | + command: "yarn test:api --shard=${{ matrix.shard }}/${{ inputs.shards }}" |
148 | 161 | workflowName: "API Tests on Venv" |
149 | 162 | secrets: inherit |
150 | 163 |
|
@@ -183,7 +196,8 @@ jobs: |
183 | 196 | if: | |
184 | 197 | always() && |
185 | 198 | (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') |
187 | 201 | uses: frontegg/workflows/.github/workflows/remove-single-venv.yaml@master |
188 | 202 | with: |
189 | 203 | venvId: ${{ needs.prepare-params.outputs.environmentId }} |
|
0 commit comments