Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose test timings token for e2e tests #37756

Merged
merged 2 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -401,6 +402,7 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
NEXT_TEST_REACT_VERSION: ^17
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -543,6 +545,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -590,6 +593,7 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
NEXT_TEST_REACT_VERSION: ^17
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
Expand Down
7 changes: 0 additions & 7 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,13 @@ async function main() {
if (isFinalRun && hideOutput) {
// limit out to last 64kb so that we don't
// run out of log room in CI
let trimmedOutputSize = 0
const trimmedOutputLimit = 64 * 1024
const trimmedOutput = []

for (let i = outputChunks.length; i >= 0; i--) {
const chunk = outputChunks[i]
if (!chunk) continue

trimmedOutputSize += chunk.byteLength || chunk.length
trimmedOutput.unshift(chunk)

if (trimmedOutputSize > trimmedOutputLimit) {
break
}
}
trimmedOutput.forEach((chunk) => process.stdout.write(chunk))
}
Expand Down
22 changes: 13 additions & 9 deletions test/e2e/next-script/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@ describe('experimental.nextScriptWorkers: true with required Partytown dependenc
try {
browser = await webdriver(next.url, '/')

const predefinedWorkerScripts = await browser.eval(
`document.querySelectorAll('script[type="text/partytown"]').length`
)
expect(predefinedWorkerScripts).toEqual(1)
await check(async () => {
const predefinedWorkerScripts = await browser.eval(
`document.querySelectorAll('script[type="text/partytown"]').length`
)
return predefinedWorkerScripts + ''
}, '1')

// Partytown modifes type to "text/partytown-x" after it has been executed in the web worker
// Partytown modifies type to "text/partytown-x" after it has been executed in the web worker
await check(async () => {
const processedWorkerScripts = await browser.eval(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
Expand All @@ -275,10 +277,12 @@ describe('experimental.nextScriptWorkers: true with required Partytown dependenc
try {
browser = await webdriver(next.url, '/')

const predefinedWorkerScripts = await browser.eval(
`document.querySelectorAll('script[type="text/partytown"]').length`
)
expect(predefinedWorkerScripts).toEqual(1)
await check(async () => {
const predefinedWorkerScripts = await browser.eval(
`document.querySelectorAll('script[type="text/partytown"]').length`
)
return predefinedWorkerScripts + ''
}, '1')

// Partytown modifes type to "text/partytown-x" after it has been executed in the web worker
await check(async () => {
Expand Down