1111 NEXT_REPO : netlify/next.js
1212 NEXT_VERSION : 13.5.1
1313 NEXT_TEST_MODE : deploy
14- NEXT_E2E_TEST_TIMEOUT : 600000
1514 NEXT_TEST_JOB : true
1615 TEST_CONCURRENCY : 8
16+ NEXT_E2E_TEST_TIMEOUT : 600000
1717 NEXT_TELEMETRY_DISABLED : 1
1818 NEXT_SKIP_NATIVE_POSTINSTALL : 1
1919 TURBO_TOKEN : ${{ secrets.TURBO_TOKEN }}
@@ -29,11 +29,11 @@ jobs:
2929 contains(github.event.pull_request.labels.*.name, 'run-e2e-tests') }}
3030 name : test e2e
3131 runs-on : ubuntu-latest
32- timeout-minutes : 25
32+ timeout-minutes : 120
3333 strategy :
3434 fail-fast : false
3535 matrix :
36- group : [1, 2, 3, 4, 5]
36+ group : [1, 2, 3, 4, 5, 6, 7, 8 ]
3737 env :
3838 next-path : next.js
3939 runtime-path : next-runtime-minimal
@@ -106,7 +106,7 @@ jobs:
106106 working-directory : ${{ env.next-path }}
107107
108108 - name : install swc
109- run : pnpm add @next/swc-linux-x64-gnu@${{ env.NEXT_VERSION }}
109+ run : pnpm add --workspace-root @next/swc-linux-x64-gnu@${{ env.NEXT_VERSION }}
110110 working-directory : ${{ env.next-path }}
111111
112112 - name : install runtime
@@ -120,6 +120,10 @@ jobs:
120120 - name : add netlify cli
121121 run : npm install -g netlify-cli
122122
123+ - name : install playwright
124+ run : npx playwright install
125+ working-directory : ${{ env.next-path }}
126+
123127 - name : set test filter
124128 run : |
125129 ls test/e2e/**/*.test.* > included_tests
@@ -132,22 +136,61 @@ jobs:
132136 env :
133137 NODE_ENV : production
134138 NEXT_EXTERNAL_TESTS_FILTERS : ./tests.json
135- run : node run-tests.js -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type e2e
139+ run : node run-tests.js -g ${{ matrix.group }}/8 -c ${TEST_CONCURRENCY} --type e2e
136140 working-directory : ${{ env.next-path }}
141+
137142 - name : Test results
138143 working-directory : ${{ env.next-path }}
139144 run : |
140145 for file in `ls test/e2e/**/*.results.json`; do
141146 test_name=$(echo $file | sed -e 's/test\/e2e\/\(.*\/.*\).results.json/\1/')
142- echo "<details>" >> $GITHUB_STEP_SUMMARY
143- echo "<summary>:x: Test failed: <code>${test_name}</code></summary>" >> $GITHUB_STEP_SUMMARY
144- echo "<pre><code>" >> $GITHUB_STEP_SUMMARY
145- cat $file | jq -r '.testResults[].message'>> $GITHUB_STEP_SUMMARY
146- echo "</code></pre>" >> $GITHUB_STEP_SUMMARY
147- echo "</details>" >> $GITHUB_STEP_SUMMARY
148- failed=true
147+
148+ success=$(jq -r '.success' $file)
149+ if [ "$success" = "true" ] ; then
150+ test_result=":white_check_mark:"
151+ else
152+ test_result=":x:"
153+ fi
154+
155+ passed=$(jq -r '.numPassedTests' $file)
156+ passed_total=$((passed_total + passed))
157+ failed=$(jq -r '.numFailedTests' $file)
158+ failed_total=$((failed_total + failed))
159+ pending=$(jq -r '.numPendingTests' $file)
160+ pending_total=$((pending_total + pending))
161+ total=$(jq -r '.numTotalTests' $file)
162+ total_total=$((total_total + total))
163+
164+ message=$(jq -r '.testResults[].message' $file)
165+
166+ echo "<details>" >> test_summary
167+ echo "<summary>${test_result} <code>${test_name}</code></summary>" >> test_summary
168+ echo "<h4>Results</h4>" >> test_summary
169+ echo "<div>Passing tests: ${passed}</div>" >> test_summary
170+ echo "<div>Failing tests: ${failed}</div>" >> test_summary
171+ echo "<div>Pending tests: ${pending}</div>" >> test_summary
172+ echo "<div>Total tests: ${total}</div>" >> test_summary
173+
174+ if [ -n "${message}" ] ; then
175+ echo "<h4>Details</h4>" >> test_summary
176+ echo "<pre><code>" >> test_summary
177+ echo $message >> test_summary
178+ echo "</code></pre>" >> test_summary
179+ fi
180+
181+ echo "</details>" >> test_summary
149182 done
150- if [ "$failed" = true ] ; then
183+
184+ echo "<h3>Results</h3>" >> $GITHUB_STEP_SUMMARY
185+ echo "<div>Passing tests: ${passed_total}</div>" >> $GITHUB_STEP_SUMMARY
186+ echo "<div>Failing tests: ${failed_total}</div>" >> $GITHUB_STEP_SUMMARY
187+ echo "<div>Pending tests: ${pending_total}</div>" >> $GITHUB_STEP_SUMMARY
188+ echo "<div>Total tests: ${total_total}</div>" >> $GITHUB_STEP_SUMMARY
189+
190+ echo "<h3>Details</h3>" >> $GITHUB_STEP_SUMMARY
191+ cat test_summary >> $GITHUB_STEP_SUMMARY
192+
193+ if [ "$failed_total" -gt 0 ] ; then
151194 echo "Failed tests. Please see action summary for details."
152195 exit 1
153196 fi
0 commit comments