Unverified Commit 8a91d468 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

refactor(CI): Merge all four bundler test manifest scripts into one (#76652)

These scripts were 95% identical, so they can just be one script that
accepts a few arguments.

```
$ node test/update-bundler-manifest.js --help
Options:
  --help        Show help                                              [boolean]
  --version     Show version number                                    [boolean]
  --bundler     The JavaScript bundler the tests were run against
                                     [required] [choices: "turbopack", "rspack"]
  --test-suite  Test group to update        [required] [choices: "dev", "build"]
  --branch      the git branch to filter CI artifacts to
                                                    [string] [default: "canary"]
  --override    Don't merge with existing test results, allowing tests to
                transition to a failed state                           [boolean]
```

Tested by running:

```
node test/update-bundler-manifest.js --bundler rspack --test-suite dev --override
node test/update-bundler-manifest.js --bundler rspack --test-suite build --override
```
parent 1ba2577a
......@@ -41,7 +41,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-dev-tests-manifest.js
# We need to use `--override` for rspack (but not for turbopack).
# We don't currently have any CI running on every PR, so it's quite
# possible for us to regress on tests. We need to skip the
# only-promote-to-passing merge logic.
SCRIPT: test/update_build_manifest.js --bundler rspack --testSuite dev --override
PR_TITLE: Update bundler development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing alternative bundlers.
update_build_manifest:
......@@ -77,6 +81,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-build-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler rspack --testSuite build --override
PR_TITLE: Update bundler production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing alternative bundlers.
......@@ -41,7 +41,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: turbopack-manifest
SCRIPT: test/build-turbopack-dev-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler turbopack --testSuite dev
PR_TITLE: Update Turbopack development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing Turbopack.
update_build_manifest:
......@@ -77,6 +77,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: turbopack-manifest
SCRIPT: test/build-turbopack-build-tests-manifest.js
SCRIPT: test/update_build_manifest.js --bundler turbopack --testSuite build
PR_TITLE: Update Turbopack production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing Turbopack.
......@@ -37,6 +37,7 @@ export interface TransformOutput {
code: string
map?: string
output?: string
diagnostics: Array<string>
}
export declare function mdxCompile(
value: string,
......
const fs = require('fs')
const os = require('os')
const path = require('path')
const prettier = require('prettier')
const execa = require('execa')
const { bold } = require('kleur')
async function format(text) {
const options = await prettier.resolveConfig(__filename)
return prettier.format(text, { ...options, parser: 'json' })
}
const override = process.argv.includes('--override')
const PASSING_JSON_PATH = `${__dirname}/rspack-build-tests-manifest.json`
const WORKING_PATH = '/root/actions-runner/_work/next.js/next.js/'
const INITIALIZING_TEST_CASES = [
'compile successfully',
'should build successfully',
]
// please make sure this is sorted alphabetically when making changes.
const SKIPPED_TEST_SUITES = {}
function checkSorted(arr, name) {
const sorted = [...arr].sort()
if (JSON.stringify(arr) !== JSON.stringify(sorted)) {
console.log(`Expected order of ${name}:`)
for (let i = 0; i < arr.length; i++) {
if (arr[i] === sorted[i]) {
console.log(` ${arr[i]}`)
} else {
console.log(bold().red(`- ${arr[i]}`))
console.log(bold().green(`+ ${sorted[i]}`))
}
}
throw new Error(`${name} is not sorted`)
}
}
checkSorted(Object.keys(SKIPPED_TEST_SUITES), 'SKIPPED_TEST_SUITES')
for (const [key, value] of Object.entries(SKIPPED_TEST_SUITES)) {
checkSorted(value, `SKIPPED_TEST_SUITES['${key}']`)
}
/**
* @param title {string}
* @param file {string}
* @param args {readonly string[]}
* @returns {execa.ExecaChildProcess}
*/
function exec(title, file, args) {
logCommand(title, `${file} ${args.join(' ')}`)
return execa(file, args, {
stderr: 'inherit',
})
}
/**
* @param {string} title
* @param {string} [command]
*/
function logCommand(title, command) {
let message = `\n${bold().underline(title)}\n`
if (command) {
message += `> ${bold(command)}\n`
}
console.log(message)
}
/**
* @returns {Promise<Artifact>}
*/
async function fetchLatestTestArtifact() {
const { stdout } = await exec(
'Getting latest test artifacts from GitHub actions',
'gh',
[
'api',
'/repos/vercel/next.js/actions/artifacts?name=test-results-rspack-production',
]
)
/** @type {ListArtifactsResponse} */
const res = JSON.parse(stdout)
for (const artifact of res.artifacts) {
if (artifact.expired || artifact.workflow_run.head_branch !== 'canary') {
continue
}
return artifact
}
throw new Error('no valid test-results artifact was found for branch canary')
}
/**
* @returns {Promise<TestResultManifest>}
*/
async function fetchTestResults() {
const artifact = await fetchLatestTestArtifact()
const subprocess = exec('Downloading artifact archive', 'gh', [
'api',
`/repos/vercel/next.js/actions/artifacts/${artifact.id}/zip`,
])
const filePath = path.join(
os.tmpdir(),
`next-test-results.${Math.floor(Math.random() * 1000).toString(16)}.zip`
)
subprocess.stdout.pipe(fs.createWriteStream(filePath))
await subprocess
const { stdout } = await exec('Extracting test results manifest', 'unzip', [
'-pj',
filePath,
'nextjs-test-results.json',
])
return JSON.parse(stdout)
}
async function updatePassingTests() {
const results = await fetchTestResults()
logCommand('Processing results...')
const passing = { __proto__: null }
for (const result of results.result) {
const runtimeError = result.data.numRuntimeErrorTestSuites > 0
for (const testResult of result.data.testResults) {
const filepath = stripWorkingPath(testResult.name)
const fileResults = (passing[filepath] ??= {
passed: [],
failed: [],
pending: [],
flakey: [],
runtimeError,
})
const skips = SKIPPED_TEST_SUITES[filepath] ?? []
const skippedPassingNames = []
let initializationFailed = false
for (const testCase of testResult.assertionResults) {
let { fullName, status } = testCase
if (
status === 'failed' &&
INITIALIZING_TEST_CASES.some((name) => fullName.includes(name))
) {
initializationFailed = true
} else if (initializationFailed) {
status = 'failed'
}
if (shouldSkip(fullName, skips)) {
if (status === 'passed') skippedPassingNames.push(fullName)
status = 'flakey'
}
// treat test-level todo as same as pending
if (status === 'todo') {
status = 'pending'
}
const statusArray = fileResults[status]
if (!statusArray) {
throw new Error(`unexpected status "${status}"`)
}
statusArray.push(fullName)
}
if (skippedPassingNames.length > 0) {
console.log(
`${bold().yellow(filepath)} has ${
skippedPassingNames.length
} passing tests that are marked as skipped:\n${skippedPassingNames
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
}
}
for (const info of Object.values(passing)) {
info.failed = [...new Set(info.failed)].sort()
info.pending = [...new Set(info.pending)].sort()
info.flakey = [...new Set(info.flakey)].sort()
info.passed = [
...new Set(info.passed.filter((name) => !info.failed.includes(name))),
].sort()
}
if (!override) {
const oldPassingData = JSON.parse(
fs.readFileSync(PASSING_JSON_PATH, 'utf8')
)
for (const file of Object.keys(oldPassingData)) {
const newData = passing[file]
const oldData = oldPassingData[file]
if (!newData) continue
// We want to find old passing tests that are now failing, and report them.
// Tests are allowed transition to skipped or flakey.
const shouldPass = new Set(
oldData.passed.filter((name) => newData.failed.includes(name))
)
if (shouldPass.size > 0) {
console.log(
`${bold().red(file)} has ${
shouldPass.size
} test(s) that should pass but failed:\n${Array.from(shouldPass)
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
// Merge the old passing tests with the new ones
newData.passed = [...new Set([...shouldPass, ...newData.passed])].sort()
// but remove them also from the failed list
newData.failed = newData.failed
.filter((name) => !shouldPass.has(name))
.sort()
if (!oldData.runtimeError && newData.runtimeError) {
console.log(
`${bold().red(file)} has a runtime error that is shouldn't have\n`
)
newData.runtimeError = false
}
}
}
// JS keys are ordered, this ensures the tests are written in a consistent order
// https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key
const ordered = Object.keys(passing)
.sort()
.reduce((obj, key) => {
obj[key] = passing[key]
return obj
}, {})
fs.writeFileSync(
PASSING_JSON_PATH,
await format(
JSON.stringify(
{
version: 2,
suites: ordered,
rules: {
include: [
'test/integration/**/*.test.{t,j}s{,x}',
'test/e2e/**/*.test.{t,j}s{,x}',
'test/production/**/*.test.{t,j}s{,x}',
],
exclude: [],
},
},
null,
2
)
)
)
}
function shouldSkip(name, skips) {
for (const skip of skips) {
if (typeof skip === 'string') {
// exact match
if (name === skip) return true
} else {
// regex
if (skip.test(name)) return true
}
}
return false
}
function stripWorkingPath(path) {
if (!path.startsWith(WORKING_PATH)) {
throw new Error(
`found unexpected working path in "${path}", expected it to begin with ${WORKING_PATH}`
)
}
return path.slice(WORKING_PATH.length)
}
updatePassingTests().catch((e) => {
console.error(e)
process.exit(1)
})
const fs = require('fs')
const os = require('os')
const path = require('path')
const prettier = require('prettier')
const execa = require('execa')
const { bold } = require('kleur')
async function format(text) {
const options = await prettier.resolveConfig(__filename)
return prettier.format(text, { ...options, parser: 'json' })
}
const override = process.argv.includes('--override')
const PASSING_JSON_PATH = `${__dirname}/rspack-dev-tests-manifest.json`
const WORKING_PATH = '/root/actions-runner/_work/next.js/next.js/'
const INITIALIZING_TEST_CASES = [
'compile successfully',
'should build successfully',
]
// please make sure this is sorted alphabetically when making changes.
const SKIPPED_TEST_SUITES = {}
function checkSorted(arr, name) {
const sorted = [...arr].sort()
if (JSON.stringify(arr) !== JSON.stringify(sorted)) {
console.log(`Expected order of ${name}:`)
for (let i = 0; i < arr.length; i++) {
if (arr[i] === sorted[i]) {
console.log(` ${arr[i]}`)
} else {
console.log(bold().red(`- ${arr[i]}`))
console.log(bold().green(`+ ${sorted[i]}`))
}
}
throw new Error(`${name} is not sorted`)
}
}
checkSorted(Object.keys(SKIPPED_TEST_SUITES), 'SKIPPED_TEST_SUITES')
for (const [key, value] of Object.entries(SKIPPED_TEST_SUITES)) {
checkSorted(value, `SKIPPED_TEST_SUITES['${key}']`)
}
/**
* @param title {string}
* @param file {string}
* @param args {readonly string[]}
* @returns {execa.ExecaChildProcess}
*/
function exec(title, file, args) {
logCommand(title, `${file} ${args.join(' ')}`)
return execa(file, args, {
stderr: 'inherit',
})
}
/**
* @param {string} title
* @param {string} [command]
*/
function logCommand(title, command) {
let message = `\n${bold().underline(title)}\n`
if (command) {
message += `> ${bold(command)}\n`
}
console.log(message)
}
/**
* @returns {Promise<Artifact>}
*/
async function fetchLatestTestArtifact() {
const { stdout } = await exec(
'Getting latest test artifacts from GitHub actions',
'gh',
[
'api',
'/repos/vercel/next.js/actions/artifacts?name=test-results-rspack-development',
]
)
/** @type {ListArtifactsResponse} */
const res = JSON.parse(stdout)
for (const artifact of res.artifacts) {
if (artifact.expired || artifact.workflow_run.head_branch !== 'canary') {
continue
}
return artifact
}
throw new Error('no valid test-results artifact was found for branch canary')
}
/**
* @returns {Promise<TestResultManifest>}
*/
async function fetchTestResults() {
const artifact = await fetchLatestTestArtifact()
const subprocess = exec('Downloading artifact archive', 'gh', [
'api',
`/repos/vercel/next.js/actions/artifacts/${artifact.id}/zip`,
])
const filePath = path.join(
os.tmpdir(),
`next-test-results.${Math.floor(Math.random() * 1000).toString(16)}.zip`
)
subprocess.stdout.pipe(fs.createWriteStream(filePath))
await subprocess
const { stdout } = await exec('Extracting test results manifest', 'unzip', [
'-pj',
filePath,
'nextjs-test-results.json',
])
return JSON.parse(stdout)
}
async function updatePassingTests() {
const results = await fetchTestResults()
logCommand('Processing results...')
const passing = { __proto__: null }
for (const result of results.result) {
const runtimeError = result.data.numRuntimeErrorTestSuites > 0
for (const testResult of result.data.testResults) {
const filepath = stripWorkingPath(testResult.name)
const fileResults = (passing[filepath] ??= {
passed: [],
failed: [],
pending: [],
flakey: [],
runtimeError,
})
const skips = SKIPPED_TEST_SUITES[filepath] ?? []
const skippedPassingNames = []
let initializationFailed = false
for (const testCase of testResult.assertionResults) {
let { fullName, status } = testCase
if (
status === 'failed' &&
INITIALIZING_TEST_CASES.some((name) => fullName.includes(name))
) {
initializationFailed = true
} else if (initializationFailed) {
status = 'failed'
}
if (shouldSkip(fullName, skips)) {
if (status === 'passed') skippedPassingNames.push(fullName)
status = 'flakey'
}
// treat test-level todo as same as pending
if (status === 'todo') {
status = 'pending'
}
const statusArray = fileResults[status]
if (!statusArray) {
throw new Error(`unexpected status "${status}"`)
}
statusArray.push(fullName)
}
if (skippedPassingNames.length > 0) {
console.log(
`${bold().yellow(filepath)} has ${
skippedPassingNames.length
} passing tests that are marked as skipped:\n${skippedPassingNames
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
}
}
for (const info of Object.values(passing)) {
info.failed = [...new Set(info.failed)].sort()
info.pending = [...new Set(info.pending)].sort()
info.flakey = [...new Set(info.flakey)].sort()
info.passed = [
...new Set(info.passed.filter((name) => !info.failed.includes(name))),
].sort()
}
if (!override) {
const oldPassingData = JSON.parse(
fs.readFileSync(PASSING_JSON_PATH, 'utf8')
)
for (const file of Object.keys(oldPassingData)) {
const newData = passing[file]
const oldData = oldPassingData[file]
if (!newData) continue
// We want to find old passing tests that are now failing, and report them.
// Tests are allowed transition to skipped or flakey.
const shouldPass = new Set(
oldData.passed.filter((name) => newData.failed.includes(name))
)
if (shouldPass.size > 0) {
console.log(
`${bold().red(file)} has ${
shouldPass.size
} test(s) that should pass but failed:\n${Array.from(shouldPass)
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
// Merge the old passing tests with the new ones
newData.passed = [...new Set([...shouldPass, ...newData.passed])].sort()
// but remove them also from the failed list
newData.failed = newData.failed
.filter((name) => !shouldPass.has(name))
.sort()
if (!oldData.runtimeError && newData.runtimeError) {
console.log(
`${bold().red(file)} has a runtime error that is shouldn't have\n`
)
newData.runtimeError = false
}
}
}
// JS keys are ordered, this ensures the tests are written in a consistent order
// https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key
const ordered = Object.keys(passing)
.sort()
.reduce((obj, key) => {
obj[key] = passing[key]
return obj
}, {})
fs.writeFileSync(
PASSING_JSON_PATH,
await format(JSON.stringify(ordered, null, 2))
)
}
function shouldSkip(name, skips) {
for (const skip of skips) {
if (typeof skip === 'string') {
// exact match
if (name === skip) return true
} else {
// regex
if (skip.test(name)) return true
}
}
return false
}
function stripWorkingPath(path) {
if (!path.startsWith(WORKING_PATH)) {
throw new Error(
`found unexpected working path in "${path}", expected it to begin with ${WORKING_PATH}`
)
}
return path.slice(WORKING_PATH.length)
}
updatePassingTests().catch((e) => {
console.error(e)
process.exit(1)
})
const fs = require('fs')
const os = require('os')
const path = require('path')
const prettier = require('prettier')
const execa = require('execa')
const { bold } = require('kleur')
async function format(text) {
const options = await prettier.resolveConfig(__filename)
return prettier.format(text, { ...options, parser: 'json' })
}
const override = process.argv.includes('--override')
const PASSING_JSON_PATH = `${__dirname}/turbopack-build-tests-manifest.json`
const WORKING_PATH = '/root/actions-runner/_work/next.js/next.js/'
const INITIALIZING_TEST_CASES = [
'compile successfully',
'should build successfully',
]
// please make sure this is sorted alphabetically when making changes.
const SKIPPED_TEST_SUITES = {}
function checkSorted(arr, name) {
const sorted = [...arr].sort()
if (JSON.stringify(arr) !== JSON.stringify(sorted)) {
console.log(`Expected order of ${name}:`)
for (let i = 0; i < arr.length; i++) {
if (arr[i] === sorted[i]) {
console.log(` ${arr[i]}`)
} else {
console.log(bold().red(`- ${arr[i]}`))
console.log(bold().green(`+ ${sorted[i]}`))
}
}
throw new Error(`${name} is not sorted`)
}
}
checkSorted(Object.keys(SKIPPED_TEST_SUITES), 'SKIPPED_TEST_SUITES')
for (const [key, value] of Object.entries(SKIPPED_TEST_SUITES)) {
checkSorted(value, `SKIPPED_TEST_SUITES['${key}']`)
}
/**
* @param title {string}
* @param file {string}
* @param args {readonly string[]}
* @returns {execa.ExecaChildProcess}
*/
function exec(title, file, args) {
logCommand(title, `${file} ${args.join(' ')}`)
return execa(file, args, {
stderr: 'inherit',
})
}
/**
* @param {string} title
* @param {string} [command]
*/
function logCommand(title, command) {
let message = `\n${bold().underline(title)}\n`
if (command) {
message += `> ${bold(command)}\n`
}
console.log(message)
}
/**
* @returns {Promise<Artifact>}
*/
async function fetchLatestTestArtifact() {
const { stdout } = await exec(
'Getting latest test artifacts from GitHub actions',
'gh',
[
'api',
'/repos/vercel/next.js/actions/artifacts?name=test-results-turbopack-production',
]
)
/** @type {ListArtifactsResponse} */
const res = JSON.parse(stdout)
for (const artifact of res.artifacts) {
if (artifact.expired || artifact.workflow_run.head_branch !== 'canary') {
continue
}
return artifact
}
throw new Error('no valid test-results artifact was found for branch canary')
}
/**
* @returns {Promise<TestResultManifest>}
*/
async function fetchTestResults() {
const artifact = await fetchLatestTestArtifact()
const subprocess = exec('Downloading artifact archive', 'gh', [
'api',
`/repos/vercel/next.js/actions/artifacts/${artifact.id}/zip`,
])
const filePath = path.join(
os.tmpdir(),
`next-test-results.${Math.floor(Math.random() * 1000).toString(16)}.zip`
)
subprocess.stdout.pipe(fs.createWriteStream(filePath))
await subprocess
const { stdout } = await exec('Extracting test results manifest', 'unzip', [
'-pj',
filePath,
'nextjs-test-results.json',
])
return JSON.parse(stdout)
}
async function updatePassingTests() {
const results = await fetchTestResults()
logCommand('Processing results...')
const passing = { __proto__: null }
for (const result of results.result) {
const runtimeError = result.data.numRuntimeErrorTestSuites > 0
for (const testResult of result.data.testResults) {
const filepath = stripWorkingPath(testResult.name)
const fileResults = (passing[filepath] ??= {
passed: [],
failed: [],
pending: [],
flakey: [],
runtimeError,
})
const skips = SKIPPED_TEST_SUITES[filepath] ?? []
const skippedPassingNames = []
let initializationFailed = false
for (const testCase of testResult.assertionResults) {
let { fullName, status } = testCase
if (
status === 'failed' &&
INITIALIZING_TEST_CASES.some((name) => fullName.includes(name))
) {
initializationFailed = true
} else if (initializationFailed) {
status = 'failed'
}
if (shouldSkip(fullName, skips)) {
if (status === 'passed') skippedPassingNames.push(fullName)
status = 'flakey'
}
// treat test-level todo as same as pending
if (status === 'todo') {
status = 'pending'
}
const statusArray = fileResults[status]
if (!statusArray) {
throw new Error(`unexpected status "${status}"`)
}
statusArray.push(fullName)
}
if (skippedPassingNames.length > 0) {
console.log(
`${bold().yellow(filepath)} has ${
skippedPassingNames.length
} passing tests that are marked as skipped:\n${skippedPassingNames
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
}
}
for (const info of Object.values(passing)) {
info.failed = [...new Set(info.failed)].sort()
info.pending = [...new Set(info.pending)].sort()
info.flakey = [...new Set(info.flakey)].sort()
info.passed = [
...new Set(info.passed.filter((name) => !info.failed.includes(name))),
].sort()
}
if (!override) {
const oldPassingData = JSON.parse(
fs.readFileSync(PASSING_JSON_PATH, 'utf8')
)
for (const file of Object.keys(oldPassingData)) {
const newData = passing[file]
const oldData = oldPassingData[file]
if (!newData) continue
// We want to find old passing tests that are now failing, and report them.
// Tests are allowed transition to skipped or flakey.
const shouldPass = new Set(
oldData.passed.filter((name) => newData.failed.includes(name))
)
if (shouldPass.size > 0) {
console.log(
`${bold().red(file)} has ${
shouldPass.size
} test(s) that should pass but failed:\n${Array.from(shouldPass)
.map((name) => ` - ${name}`)
.join('\n')}\n`
)
}
// Merge the old passing tests with the new ones
newData.passed = [...new Set([...shouldPass, ...newData.passed])].sort()
// but remove them also from the failed list
newData.failed = newData.failed
.filter((name) => !shouldPass.has(name))
.sort()
if (!oldData.runtimeError && newData.runtimeError) {
console.log(
`${bold().red(file)} has a runtime error that is shouldn't have\n`
)
newData.runtimeError = false
}
}
}
// JS keys are ordered, this ensures the tests are written in a consistent order
// https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key
const ordered = Object.keys(passing)
.sort()
.reduce((obj, key) => {
obj[key] = passing[key]
return obj
}, {})
fs.writeFileSync(
PASSING_JSON_PATH,
await format(
JSON.stringify(
{
version: 2,
suites: ordered,
rules: {
include: [
'test/integration/**/*.test.{t,j}s{,x}',
'test/e2e/**/*.test.{t,j}s{,x}',
'test/production/**/*.test.{t,j}s{,x}',
],
exclude: [],
},
},
null,
2
)
)
)
}
function shouldSkip(name, skips) {
for (const skip of skips) {
if (typeof skip === 'string') {
// exact match
if (name === skip) return true
} else {
// regex
if (skip.test(name)) return true
}
}
return false
}
function stripWorkingPath(path) {
if (!path.startsWith(WORKING_PATH)) {
throw new Error(
`found unexpected working path in "${path}", expected it to begin with ${WORKING_PATH}`
)
}
return path.slice(WORKING_PATH.length)
}
updatePassingTests().catch((e) => {
console.error(e)
process.exit(1)
})
{
"version": 2,
"suites": {
"test/e2e/404-page-router/index.test.ts": {
"passed": [
"404-page-router 404-page-router with basePath of false and i18n of false and middleware false for /error should have the correct router parameters after it is ready",
......@@ -2025,9 +2023,7 @@
"runtimeError": false
},
"test/e2e/app-dir/dynamic-io/dynamic-io.connection.test.ts": {
"passed": [
"dynamic-io should produce dynamic pages when using connection"
],
"passed": ["dynamic-io should produce dynamic pages when using connection"],
"failed": [],
"pending": [],
"flakey": [],
......@@ -5491,9 +5487,7 @@
"test/e2e/app-dir/turbopack-loader-resource-query/turbopack-loader-resource-query.test.ts": {
"passed": [],
"failed": [],
"pending": [
"turbopack-loader-resource-query should pass query to loader"
],
"pending": ["turbopack-loader-resource-query should pass query to loader"],
"flakey": [],
"runtimeError": false
},
......@@ -7594,9 +7588,7 @@
"runtimeError": false
},
"test/e2e/persistent-caching/persistent-caching.test.ts": {
"passed": [
"persistent-caching should allow to change files while stopped"
],
"passed": ["persistent-caching should allow to change files while stopped"],
"failed": ["persistent-caching should persistent cache loaders"],
"pending": [],
"flakey": [],
......@@ -8027,9 +8019,7 @@
"transpile packages optional deps should not throw an error when optional deps are not installed"
],
"failed": [],
"pending": [
"transpile packages should handle optional peer dependencies"
],
"pending": ["transpile packages should handle optional peer dependencies"],
"flakey": [],
"runtimeError": false
},
......@@ -14230,9 +14220,7 @@
"test/integration/initial-ref/test/index.test.js": {
"passed": ["Initial Refs production mode Has correct initial ref values"],
"failed": [],
"pending": [
"Initial Refs development mode Has correct initial ref values"
],
"pending": ["Initial Refs development mode Has correct initial ref values"],
"flakey": [],
"runtimeError": false
},
......@@ -15493,9 +15481,7 @@
},
"test/integration/next-image-new/invalid-image-import/test/index.test.ts": {
"passed": [],
"failed": [
"Missing Import Image Tests production mode should show error"
],
"failed": ["Missing Import Image Tests production mode should show error"],
"pending": [
"Missing Import Image Tests development mode should show error"
],
......@@ -16413,9 +16399,7 @@
"runtimeError": false
},
"test/integration/root-catchall-cache/test/index.test.js": {
"passed": [
"Root Catch-all Cache production mode should cache / correctly"
],
"passed": ["Root Catch-all Cache production mode should cache / correctly"],
"failed": [],
"pending": [],
"flakey": [],
......@@ -18859,13 +18843,4 @@
"flakey": [],
"runtimeError": false
}
},
"rules": {
"include": [
"test/integration/**/*.test.{t,j}s{,x}",
"test/e2e/**/*.test.{t,j}s{,x}",
"test/production/**/*.test.{t,j}s{,x}"
],
"exclude": []
}
}
......@@ -2123,11 +2123,12 @@
"ReactRefreshRegression can fast refresh a page with config",
"ReactRefreshRegression can fast refresh a page with getServerSideProps",
"ReactRefreshRegression can fast refresh a page with getStaticProps",
"ReactRefreshRegression custom loader mdx should have Fast Refresh enabled",
"ReactRefreshRegression shows an overlay for a server-side error",
"ReactRefreshRegression styled-components hydration mismatch"
],
"failed": [],
"failed": [
"ReactRefreshRegression custom loader mdx should have Fast Refresh enabled"
],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -2160,12 +2161,12 @@
"passed": [
"pages/ error recovery logbox: can recover from a component error",
"pages/ error recovery logbox: can recover from a event handler error",
"pages/ error recovery render error not shown right after syntax error",
"pages/ error recovery stuck error",
"pages/ error recovery syntax > runtime error"
"pages/ error recovery stuck error"
],
"failed": [
"pages/ error recovery logbox: can recover from a syntax error without losing state"
"pages/ error recovery logbox: can recover from a syntax error without losing state",
"pages/ error recovery render error not shown right after syntax error",
"pages/ error recovery syntax > runtime error"
],
"pending": [],
"flakey": [],
......@@ -2284,8 +2285,8 @@
"runtimeError": false
},
"test/development/app-dir/dev-fetch-hmr/dev-fetch-hmr.test.ts": {
"passed": ["dev-fetch-hmr should retain module level fetch patching"],
"failed": [],
"passed": [],
"failed": ["dev-fetch-hmr should retain module level fetch patching"],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -2341,12 +2342,12 @@
},
"test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts": {
"passed": [
"Dynamic IO Dev Errors should clear segment errors after correcting them",
"Dynamic IO Dev Errors should not log unhandled rejections for persistently thrown top-level errors",
"Dynamic IO Dev Errors should show a red box error on client navigations",
"Dynamic IO Dev Errors should show a red box error on the SSR render"
],
"failed": [
"Dynamic IO Dev Errors should clear segment errors after correcting them",
"Dynamic IO Dev Errors should display error when component accessed data without suspense boundary"
],
"pending": [],
......@@ -2489,7 +2490,7 @@
],
"pending": [],
"flakey": [],
"runtimeError": false
"runtimeError": true
},
"test/development/app-dir/logging-incoming-request/logging-incoming-request-false.test.ts": {
"passed": [
......@@ -2613,12 +2614,12 @@
},
"test/development/app-dir/server-navigation-error/server-navigation-error.test.ts": {
"passed": [
"server-navigation-error pages router should error on navigation API notFound",
"server-navigation-error pages router should error on navigation API redirect"
],
"failed": [
"server-navigation-error middleware should error on navigation API not-found",
"server-navigation-error middleware should error on navigation API redirect "
"server-navigation-error middleware should error on navigation API redirect ",
"server-navigation-error pages router should error on navigation API notFound"
],
"pending": [],
"flakey": [],
......@@ -2821,12 +2822,10 @@
},
"test/development/basic/hmr/error-recovery.test.ts": {
"passed": [
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should have client HMR events in trace file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after a bad return from the render function",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after an error reported via SSR",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after exporting an invalid page",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after undefined exported as default",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after webpack parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover from 404 after a page has been added",
......@@ -2834,12 +2833,10 @@
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover from errors in getInitialProps in client",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover from errors in the render function",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should show the error on all pages",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should have client HMR events in trace file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after a bad return from the render function",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after an error reported via SSR",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after exporting an invalid page",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after undefined exported as default",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after webpack parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover from 404 after a page has been added",
......@@ -2847,12 +2844,10 @@
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover from errors in getInitialProps in client",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover from errors in the render function",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should show the error on all pages",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should have client HMR events in trace file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after a bad return from the render function",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after an error reported via SSR",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after exporting an invalid page",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after undefined exported as default",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after webpack parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover from 404 after a page has been added",
......@@ -2860,12 +2855,10 @@
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover from errors in getInitialProps in client",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover from errors in the render function",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should show the error on all pages",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should have client HMR events in trace file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after a bad return from the render function",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after an error reported via SSR",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after exporting an invalid page",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after undefined exported as default",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after webpack parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover from 404 after a page has been added",
......@@ -2876,13 +2869,21 @@
],
"failed": [
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should detect runtime errors on the module scope",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should not continously poll a custom error page",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should detect runtime errors on the module scope",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should not continously poll a custom error page",
"HMR - Error Recovery, nextConfig: { basePath: '', assetPrefix: '/asset-prefix' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should detect runtime errors on the module scope",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should not continously poll a custom error page",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '' } should recover after loader parse error in an imported file",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should detect runtime errors on the module scope",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should not continously poll a custom error page"
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should detect syntax errors and recover",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should not continously poll a custom error page",
"HMR - Error Recovery, nextConfig: { basePath: '/docs', assetPrefix: '/asset-prefix' } should recover after loader parse error in an imported file"
],
"pending": [],
"flakey": [],
......@@ -3321,7 +3322,6 @@
"middleware - development errors when there is a compilation error after boot logs the error correctly",
"middleware - development errors when there is a compilation error after boot renders the error correctly and recovers",
"middleware - development errors when there is a compilation error from boot logs the error correctly",
"middleware - development errors when there is a compilation error from boot renders the error correctly and recovers",
"middleware - development errors when there is an unhandled rejection while loading a dependency does not render the error",
"middleware - development errors when there is an unhandled rejection while loading a dependency logs the error correctly",
"middleware - development errors when there is an unhandled rejection while loading the module does not render the error",
......@@ -3332,6 +3332,7 @@
"middleware - development errors when middleware contains an unhandled rejection logs the error correctly",
"middleware - development errors when middleware throws synchronously logs the error correctly",
"middleware - development errors when running invalid dynamic code with eval logs the error correctly",
"middleware - development errors when there is a compilation error from boot renders the error correctly and recovers",
"middleware - development errors when throwing while loading the module logs the error correctly"
],
"pending": [],
......@@ -3414,7 +3415,6 @@
"Client Navigation resets scroll at the correct time should reset scroll before the new page runs its lifecycles (<Link />)",
"Client Navigation resets scroll at the correct time should reset scroll before the new page runs its lifecycles (Router#push)",
"Client Navigation runtime errors should show redbox when a client side error is thrown inside a component",
"Client Navigation runtime errors should show redbox when a client side error is thrown outside a component",
"Client Navigation should emit routeChangeError on hash change cancel",
"Client Navigation should handle boolean async prop in next/script client-side: false",
"Client Navigation should handle boolean async prop in next/script client-side: true",
......@@ -3462,7 +3462,6 @@
"Client Navigation with different types of urls should work with / page",
"Client Navigation with different types of urls should work with dir/ page",
"Client Navigation with different types of urls should work with normal page",
"Client Navigation with empty getInitialProps() should render a redbox",
"Client Navigation with getInitialProp redirect should redirect the page via client side",
"Client Navigation with getInitialProp redirect should redirect the page when loading",
"Client Navigation with hash changes check hydration mis-match should not have hydration mis-match for hash link",
......@@ -3516,7 +3515,10 @@
"updating <Head /> with strictNextHead=true while client routing should warn when scripts are in head",
"updating <Head /> with strictNextHead=true while client routing should warn when stylesheets or scripts are in head"
],
"failed": [],
"failed": [
"Client Navigation runtime errors should show redbox when a client side error is thrown outside a component",
"Client Navigation with empty getInitialProps() should render a redbox"
],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -3999,7 +4001,7 @@
"failed": ["app dir HMR should not cause error when removing loading.js"],
"pending": [],
"flakey": [],
"runtimeError": false
"runtimeError": true
},
"test/e2e/app-dir/app-config-crossorigin/index.test.ts": {
"passed": [
......@@ -4341,8 +4343,8 @@
"runtimeError": false
},
"test/e2e/app-dir/app-routes-subrequests/app-routes-subrequests.test.ts": {
"passed": ["app-routes-subrequests shortcuts after 5 subrequests"],
"failed": [],
"passed": [],
"failed": ["app-routes-subrequests shortcuts after 5 subrequests"],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -4727,7 +4729,6 @@
"app dir - basic <Link /> should soft replace",
"app dir - basic HMR should HMR correctly for client component",
"app dir - basic HMR should HMR correctly for server component",
"app dir - basic bootstrap scripts should fail to bootstrap when using CSP in Dev due to eval",
"app dir - basic bootstrap scripts should only bootstrap with one script, prinitializing the rest",
"app dir - basic data fetch with response over 16KB with chunked encoding should load page when fetching a large amount of data",
"app dir - basic known bugs should handle as on next/link",
......@@ -4817,6 +4818,7 @@
],
"failed": [
"app dir - basic <Link /> should navigate to pages dynamic route from pages page if it overlaps with an app page",
"app dir - basic bootstrap scripts should fail to bootstrap when using CSP in Dev due to eval",
"app dir - basic should serve polyfills for browsers that do not support modules"
],
"pending": [
......@@ -5342,10 +5344,10 @@
"runtimeError": false
},
"test/e2e/app-dir/dynamic-import/dynamic-import.test.ts": {
"passed": [
"passed": [],
"failed": [
"dynamic-import should render the dynamically imported component"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -5464,11 +5466,11 @@
"runtimeError": false
},
"test/e2e/app-dir/dynamic-io-segment-configs/dynamic-io-segment-configs.test.ts": {
"passed": [
"passed": [],
"failed": [
"dynamic-io-segment-configs it should error when using segment configs that aren't supported by dynamicIO",
"dynamic-io-segment-configs should propagate configurations from layouts to pages"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -5822,17 +5824,16 @@
"runtimeError": false
},
"test/e2e/app-dir/error-on-next-codemod-comment/error-on-next-codemod-comment.test.ts": {
"passed": [
"app-dir - error-on-next-codemod-comment should error with inline comment as well"
],
"passed": [],
"failed": [
"app-dir - error-on-next-codemod-comment should disappear the error when you replace with bypass comment",
"app-dir - error-on-next-codemod-comment should disappear the error when you rre the codemod comment",
"app-dir - error-on-next-codemod-comment should error with inline comment as well",
"app-dir - error-on-next-codemod-comment should error with swc if you have codemod comments left"
],
"pending": [],
"flakey": [],
"runtimeError": false
"runtimeError": true
},
"test/e2e/app-dir/errors/index.test.ts": {
"passed": [
......@@ -6182,7 +6183,6 @@
"passed": [
"app-dir - fetch logging placeholder to satisfy at least one test when isNextDev is false",
"app-dir - fetch logging should not log requests for HMR refreshes",
"app-dir - logging with default logging should not contain metadata internal segments for dynamic metadata routes",
"app-dir - logging with default logging should not contain trailing word page for app router routes",
"app-dir - logging with default logging should not log fetch requests at all",
"app-dir - logging with fetches default logging should exclude Middleware invoked and _rsc requests",
......@@ -6222,7 +6222,6 @@
"app-dir - logging with verbose logging for edge runtime should log each page request only once",
"app-dir - logging with verbose logging for edge runtime should log requests for client-side navigations",
"app-dir - logging with verbose logging for edge runtime should log requests with correct indentation",
"app-dir - logging with verbose logging for edge runtime should not contain metadata internal segments for dynamic metadata routes",
"app-dir - logging with verbose logging for edge runtime should not contain trailing word page for app router routes",
"app-dir - logging with verbose logging for edge runtime should not limit the number of requests that are logged",
"app-dir - logging with verbose logging for edge runtime should not log _rsc query for client navigation RSC request",
......@@ -6231,7 +6230,10 @@
"app-dir - logging with verbose logging for edge runtime should show cache reason of noStore when use with fetch",
"app-dir - logging with verbose logging for edge runtime when logging.fetches.hmrRefreshes is true should log requests for HMR refreshes"
],
"failed": [],
"failed": [
"app-dir - logging with default logging should not contain metadata internal segments for dynamic metadata routes",
"app-dir - logging with verbose logging for edge runtime should not contain metadata internal segments for dynamic metadata routes"
],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -7981,10 +7983,11 @@
"app dir - rsc basics should support streaming for flight response",
"app dir - rsc basics should suspense next/image in server components",
"app dir - rsc basics should suspense next/legacy/image in server components",
"app dir - rsc basics should track client components in dynamic imports",
"app dir - rsc basics should use canary react for app"
],
"failed": [],
"failed": [
"app dir - rsc basics should track client components in dynamic imports"
],
"pending": [
"app dir - rsc basics should support partial hydration with inlined server data in browser"
],
......@@ -9157,7 +9160,6 @@
"test/e2e/cancel-request/stream-cancel.test.ts": {
"passed": [
"streaming responses cancel inner stream after disconnect edge app route handler cancels stalled stream",
"streaming responses cancel inner stream after disconnect edge app route handler cancels stream making progress",
"streaming responses cancel inner stream after disconnect edge app route handler cancels stream that never sent data",
"streaming responses cancel inner stream after disconnect edge pages api cancels stalled stream",
"streaming responses cancel inner stream after disconnect edge pages api cancels stream making progress",
......@@ -9172,7 +9174,9 @@
"streaming responses cancel inner stream after disconnect node pages api cancels stream making progress",
"streaming responses cancel inner stream after disconnect node pages api cancels stream that never sent data"
],
"failed": [],
"failed": [
"streaming responses cancel inner stream after disconnect edge app route handler cancels stream making progress"
],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -10397,7 +10401,7 @@
],
"pending": [],
"flakey": [],
"runtimeError": false
"runtimeError": true
},
"test/e2e/multi-zone/multi-zone.test.ts": {
"passed": [
......@@ -10438,17 +10442,17 @@
"runtimeError": false
},
"test/e2e/new-link-behavior/material-ui.test.ts": {
"passed": [
"passed": [],
"failed": [
"New Link Behavior with material-ui should render MuiLink with <a>"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/e2e/new-link-behavior/stitches.test.ts": {
"passed": ["New Link Behavior with stitches should render <a>"],
"failed": [],
"passed": [],
"failed": ["New Link Behavior with stitches should render <a>"],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -10564,10 +10568,10 @@
"runtimeError": false
},
"test/e2e/next-image-forward-ref/index.test.ts": {
"passed": [
"passed": [],
"failed": [
"next-image-forward-ref allows framer-motion to animate opacity"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -11763,11 +11767,12 @@
},
"test/integration/app-dir-export/test/dynamic-missing-gsp-dev.test.ts": {
"passed": [
"app dir - with output export - dynamic missing gsp dev development mode should error when client component has generateStaticParams",
"app dir - with output export - dynamic missing gsp dev development mode should error when dynamic route is missing generateStaticParams",
"app dir - with output export - dynamic missing gsp dev development mode should error when dynamic route is set to true"
],
"failed": [],
"failed": [
"app dir - with output export - dynamic missing gsp dev development mode should error when client component has generateStaticParams"
],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -12526,13 +12531,13 @@
"runtimeError": false
},
"test/integration/create-next-app/templates/app-api.test.ts": {
"passed": [
"passed": [],
"failed": [
"create-next-app --api (Headless App) should create JavaScript project with --js flag",
"create-next-app --api (Headless App) should create TypeScript project with --ts flag",
"create-next-app --api (Headless App) should create project inside \"src\" directory with --src-dir flag",
"create-next-app --api (Headless App) should enable turbopack dev with --turbopack flag"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
......@@ -13899,7 +13904,6 @@
"Edge runtime code with imports Edge API importing vanilla 3rd party module does not throw in dev at runtime",
"Edge runtime code with imports Edge API using Buffer polyfill does not throw in dev at runtime",
"Edge runtime code with imports Middleware importing vanilla 3rd party module does not throw in dev at runtime",
"Edge runtime code with imports Middleware statically importing 3rd party module throws not-found module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware using Buffer polyfill does not throw in dev at runtime"
],
"failed": [
......@@ -13907,7 +13911,8 @@
"Edge runtime code with imports Edge API dynamically importing node.js module in a lib development mode throws unsupported module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Edge API statically importing 3rd party module throws not-found module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware dynamically importing node.js module development mode throws unsupported module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware dynamically importing node.js module in a lib development mode throws unsupported module error in dev at runtime and highlights the faulty line"
"Edge runtime code with imports Middleware dynamically importing node.js module in a lib development mode throws unsupported module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware statically importing 3rd party module throws not-found module error in dev at runtime and highlights the faulty line"
],
"pending": [
"Edge runtime code with imports Edge API dynamically importing node.js module in a lib production mode throws unsupported module error in production at runtime and prints error on logs",
const fs = require('fs')
const os = require('os')
const path = require('path')
const fs = require('node:fs/promises')
const os = require('node:os')
const path = require('node:path')
const prettier = require('prettier')
const execa = require('execa')
const { bold } = require('kleur')
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
async function format(text) {
const options = await prettier.resolveConfig(__filename)
return prettier.format(text, { ...options, parser: 'json' })
}
const override = process.argv.includes('--override')
const PASSING_JSON_PATH = `${__dirname}/turbopack-dev-tests-manifest.json`
const WORKING_PATH = '/root/actions-runner/_work/next.js/next.js/'
const INITIALIZING_TEST_CASES = [
......@@ -24,6 +18,29 @@ const INITIALIZING_TEST_CASES = [
// please make sure this is sorted alphabetically when making changes.
const SKIPPED_TEST_SUITES = {}
const { argv } = yargs(hideBin(process.argv))
.choices('bundler', ['turbopack', 'rspack'])
.describe('bundler', 'The JavaScript bundler the tests were run against')
.choices('test-suite', ['dev', 'build'])
.describe('test-suite', 'Test group to update')
.demandOption(['bundler', 'test-suite'])
.string('branch')
.describe('branch', 'the git branch to filter CI artifacts to')
.default('branch', 'canary')
.boolean('override')
.describe(
'override',
"Don't merge with existing test results, allowing tests to transition to " +
'a failed state'
)
const manifestJsonPath = `${__dirname}/${argv.bundler}-${argv.testSuite}-tests-manifest.json`
async function format(text) {
const options = await prettier.resolveConfig(__filename)
return prettier.format(text, { ...options, parser: 'json' })
}
function checkSorted(arr, name) {
const sorted = [...arr].sort()
if (JSON.stringify(arr) !== JSON.stringify(sorted)) {
......@@ -78,20 +95,20 @@ function logCommand(title, command) {
* @returns {Promise<Artifact>}
*/
async function fetchLatestTestArtifact() {
const artifactSlug = `test-results-${argv.bundler}-${
argv.testSuite === 'dev' ? 'development' : 'production'
}`
const { stdout } = await exec(
'Getting latest test artifacts from GitHub actions',
'gh',
[
'api',
'/repos/vercel/next.js/actions/artifacts?name=test-results-turbopack-development',
]
['api', `/repos/vercel/next.js/actions/artifacts?name=${artifactSlug}`]
)
/** @type {ListArtifactsResponse} */
const res = JSON.parse(stdout)
for (const artifact of res.artifacts) {
if (artifact.expired || artifact.workflow_run.head_branch !== 'canary') {
if (artifact.expired || artifact.workflow_run.head_branch !== argv.branch) {
continue
}
......@@ -99,7 +116,7 @@ async function fetchLatestTestArtifact() {
}
throw new Error(
'no valid test-results-turbopack-development artifact was found for branch canary'
`no valid test-results artifact was found for branch ${argv.branch}`
)
}
......@@ -116,12 +133,19 @@ async function fetchTestResults() {
const filePath = path.join(
os.tmpdir(),
`next-test-results.${Math.floor(Math.random() * 1000).toString(16)}.zip`
`next-test-results.${Math.floor(Math.random() * 100000).toString(16)}.zip`
)
subprocess.stdout.pipe(fs.createWriteStream(filePath))
let file
try {
file = await fs.open(filePath, 'w')
subprocess.stdout.pipe(file.createWriteStream())
await subprocess
} finally {
await file.close()
}
const { stdout } = await exec('Extracting test results manifest', 'unzip', [
'-pj',
......@@ -129,6 +153,8 @@ async function fetchTestResults() {
'nextjs-test-results.json',
])
await fs.unlink(filePath)
return JSON.parse(stdout)
}
......@@ -204,10 +230,12 @@ async function updatePassingTests() {
].sort()
}
if (!override) {
const oldPassingData = JSON.parse(
fs.readFileSync(PASSING_JSON_PATH, 'utf8')
)
if (!argv.override) {
let oldPassingData = JSON.parse(await fs.readFile(manifestJsonPath, 'utf8'))
if (oldPassingData.version === 2) {
oldPassingData = oldPassingData.suites
}
for (const file of Object.keys(oldPassingData)) {
const newData = passing[file]
......@@ -253,8 +281,8 @@ async function updatePassingTests() {
return obj
}, {})
fs.writeFileSync(
PASSING_JSON_PATH,
await fs.writeFile(
manifestJsonPath,
await format(JSON.stringify(ordered, null, 2))
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment