Skip to content

Commit 9727c6b

Browse files
authored
chore(e2e): still more e2e report fixes (#578)
* chore(e2e): fix e2e result deduping for [email protected] Example broken run: https://github.com/netlify/next-runtime-minimal/actions/runs/9410953045. * chore(e2e): fix summary counts when deduping occurs We were updating summary tallies as side effects of building up the report, but when I introduced deduping of test suite retries, this led to a discrepancy between the results in the report and the summary counts. I could have fixed this by subtracting the right counts from the running tallies when deduping, but it seemed cleaner to just refactor this to summary counts computed purely from the final results. As a bonus, this makes it a lot more obvious that the skipped count makes no sense. I translated the logic as is, but I'll try to fix this in the next commit. * chore(e2e): more explicitly output skip counts It was really misleading and error prone. This also removes the total, since it wasn't necessary and it was also misleading. We were calculating it as `passed + failed + individually skipped tests` and then only using it in one place, which subtracted the individually skipped tests back out. This also updates the local dev fixtures.
1 parent 3384245 commit 9727c6b

File tree

6 files changed

+8098
-4287
lines changed

6 files changed

+8098
-4287
lines changed

e2e-report/app/page.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Hero from '../components/hero.js'
44
import testData from '../data/test-results.json'
55

66
export default function Home() {
7-
const { results, passed, failed, total, passRate, skipped, testDate, nextVersion } = testData
7+
const { results, passed, failed, passRate, testDate, nextVersion } = testData
88
const skippedSuites = results.filter(({ skipped }) => skipped === true)
99
const skippedTestCases = results.flatMap(
1010
({ testCases }) => testCases?.filter(({ status }) => status === 'skipped') ?? [],
@@ -16,7 +16,7 @@ export default function Home() {
1616
return (
1717
<>
1818
<header className="hero">
19-
<Hero passed={passed} failed={failed} total={total} passRate={passRate} skipped={skipped} />
19+
<Hero passed={passed} failed={failed} passRate={passRate} />
2020
</header>
2121
<div className="title">
2222
<h2>E2E Test Results</h2>

e2e-report/components/hero.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Image from 'next/image.js'
22

3-
export default function Hero({ passed, failed, total, passRate, skipped }) {
4-
const totalWithoutSkipped = total - skipped
3+
export default function Hero({ passed, failed, passRate }) {
4+
const total = passed + failed
55
return (
66
<>
77
<div className="testResults">
@@ -19,8 +19,7 @@ export default function Hero({ passed, failed, total, passRate, skipped }) {
1919
<br /> Pass rate
2020
</h3>
2121
<h3>
22-
<span>{passed.toLocaleString()}</span> of{' '}
23-
<span>{totalWithoutSkipped.toLocaleString()}</span>
22+
<span>{passed.toLocaleString()}</span> of <span>{total.toLocaleString()}</span>
2423
<br /> Next.js tests passing
2524
</h3>
2625
<h3>

0 commit comments

Comments
 (0)