Skip to content

Commit

Permalink
Expose test timings token for e2e tests (#37756)
Browse files Browse the repository at this point in the history
* Expose test timings token for e2e tests

* update flake
  • Loading branch information
ijjk authored Jun 16, 2022
1 parent 97395b4 commit a4abc1e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
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

0 comments on commit a4abc1e

Please sign in to comment.