Skip to content

Commit eea8316

Browse files
Copilotpelikhan
andcommitted
Implement matrix strategy for e2e test execution
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 6af0959 commit eea8316

2 files changed

Lines changed: 39 additions & 4 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ permissions:
1717
jobs:
1818
e2e:
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
test-suite:
23+
- name: "workflow-dispatch"
24+
option: "--workflow-dispatch-only"
25+
description: "Direct workflow triggers"
26+
- name: "issue-triggered"
27+
option: "--issue-triggered-only"
28+
description: "Tests via issue creation"
29+
- name: "command-triggered"
30+
option: "--command-triggered-only"
31+
description: "Tests via comments"
32+
fail-fast: false
33+
name: "E2E Tests: ${{ matrix.test-suite.description }}"
2034
steps:
2135
- name: Checkout
2236
uses: actions/checkout@v4
@@ -39,16 +53,16 @@ jobs:
3953
4054
# Run the e2e script, tee output to both stdout and log, capture exit code
4155
set +e
42-
./e2e.sh 2>&1 | tee e2e-output.log
56+
./e2e.sh ${{ matrix.test-suite.option }} 2>&1 | tee e2e-output.log
4357
rc=${PIPESTATUS[0]}
4458
set -e
4559
46-
echo "\n## E2E test run output" >> "$GITHUB_STEP_SUMMARY"
60+
echo "\n## E2E test run output (${{ matrix.test-suite.description }})" >> "$GITHUB_STEP_SUMMARY"
4761
echo '``````bash' >> "$GITHUB_STEP_SUMMARY"
4862
sed -n '1,50000p' e2e-output.log >> "$GITHUB_STEP_SUMMARY" || true
4963
echo '``````' >> "$GITHUB_STEP_SUMMARY"
5064
51-
echo "Detailed log attached as artifact: e2e-output.log"
65+
echo "Detailed log attached as artifact: e2e-output-${{ matrix.test-suite.name }}.log"
5266
5367
# Fail the job if the script exited non-zero so GH shows failure status
5468
if [[ $rc -ne 0 ]]; then
@@ -59,5 +73,5 @@ jobs:
5973
if: always()
6074
uses: actions/upload-artifact@v4
6175
with:
62-
name: e2e-output-log
76+
name: e2e-output-${{ matrix.test-suite.name }}-log
6377
path: e2e-output.log

e2e.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,11 +1268,32 @@ main() {
12681268
dry_run=true
12691269
shift
12701270
;;
1271+
--workflow-dispatch-only)
1272+
run_workflow_dispatch=true
1273+
run_issue_triggered=false
1274+
run_command_triggered=false
1275+
shift
1276+
;;
1277+
--issue-triggered-only)
1278+
run_workflow_dispatch=false
1279+
run_issue_triggered=true
1280+
run_command_triggered=false
1281+
shift
1282+
;;
1283+
--command-triggered-only)
1284+
run_workflow_dispatch=false
1285+
run_issue_triggered=false
1286+
run_command_triggered=true
1287+
shift
1288+
;;
12711289
--help|-h)
12721290
echo "Usage: $0 [OPTIONS] [TEST_PATTERNS...]"
12731291
echo ""
12741292
echo "Options:"
12751293
echo " --dry-run, -n Show what would be tested without running"
1294+
echo " --workflow-dispatch-only Run only workflow dispatch tests"
1295+
echo " --issue-triggered-only Run only issue-triggered tests"
1296+
echo " --command-triggered-only Run only command-triggered tests"
12761297
echo " --help, -h Show this help message"
12771298
echo ""
12781299
echo "TEST_PATTERNS:"

0 commit comments

Comments
 (0)