Update flakey dev AMP tests (#41428)

These tests have been flakey for a quite a while and this blocks changes
that are unrelated so this skips them for now.

x-ref:
https://github.com/vercel/next.js/actions/runs/3250190671/jobs/5333599972
x-ref:
https://github.com/vercel/next.js/actions/runs/3219413821/jobs/5264815514
This commit is contained in:
JJ Kasper 2022-10-14 12:04:55 -07:00 committed by GitHub
parent 8c4ef5cbc7
commit 0d376b3684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 22 deletions

View file

@ -251,7 +251,7 @@ export function getDefineEnv({
'process.env.__NEXT_I18N_DOMAINS': JSON.stringify(config.i18n?.domains),
'process.env.__NEXT_ANALYTICS_ID': JSON.stringify(config.analyticsId),
'process.env.__NEXT_ALLOW_MIDDLEWARE_RESPONSE_BODY': JSON.stringify(
config.experimental.dangerouslyAllowMiddlewareResponseBody
config.experimental.allowMiddlewareResponseBody
),
'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE': JSON.stringify(
config.experimental.skipMiddlewareUrlNormalize
@ -1895,8 +1895,8 @@ export default async function getBaseWebpackConfig(
dev,
sriEnabled: !dev && !!config.experimental.sri?.algorithm,
hasFontLoaders: !!config.experimental.fontLoaders,
dangerouslyAllowMiddlewareResponseBody:
!!config.experimental.dangerouslyAllowMiddlewareResponseBody,
allowMiddlewareResponseBody:
!!config.experimental.allowMiddlewareResponseBody,
}),
isClient &&
new BuildManifestPlugin({

View file

@ -340,14 +340,14 @@ function getCodeAnalyzer(params: {
dev: boolean
compiler: webpack.Compiler
compilation: webpack.Compilation
dangerouslyAllowMiddlewareResponseBody: boolean
allowMiddlewareResponseBody: boolean
}) {
return (parser: webpack.javascript.JavascriptParser) => {
const {
dev,
compiler: { webpack: wp },
compilation,
dangerouslyAllowMiddlewareResponseBody,
allowMiddlewareResponseBody,
} = params
const { hooks } = parser
@ -563,7 +563,7 @@ Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`,
.tap(NAME, handleWrapWasmInstantiateExpression)
}
if (!dangerouslyAllowMiddlewareResponseBody) {
if (!allowMiddlewareResponseBody) {
hooks.new.for('Response').tap(NAME, handleNewResponseExpression)
hooks.new.for('NextResponse').tap(NAME, handleNewResponseExpression)
}
@ -806,24 +806,23 @@ export default class MiddlewarePlugin {
private readonly dev: boolean
private readonly sriEnabled: boolean
private readonly hasFontLoaders: boolean
private readonly dangerouslyAllowMiddlewareResponseBody: boolean
private readonly allowMiddlewareResponseBody: boolean
constructor({
dev,
sriEnabled,
hasFontLoaders,
dangerouslyAllowMiddlewareResponseBody,
allowMiddlewareResponseBody,
}: {
dev: boolean
sriEnabled: boolean
hasFontLoaders: boolean
dangerouslyAllowMiddlewareResponseBody: boolean
allowMiddlewareResponseBody: boolean
}) {
this.dev = dev
this.sriEnabled = sriEnabled
this.hasFontLoaders = hasFontLoaders
this.dangerouslyAllowMiddlewareResponseBody =
dangerouslyAllowMiddlewareResponseBody
this.allowMiddlewareResponseBody = allowMiddlewareResponseBody
}
public apply(compiler: webpack.Compiler) {
@ -836,8 +835,7 @@ export default class MiddlewarePlugin {
dev: this.dev,
compiler,
compilation,
dangerouslyAllowMiddlewareResponseBody:
this.dangerouslyAllowMiddlewareResponseBody,
allowMiddlewareResponseBody: this.allowMiddlewareResponseBody,
})
hooks.parser.for('javascript/auto').tap(NAME, codeAnalyzer)
hooks.parser.for('javascript/dynamic').tap(NAME, codeAnalyzer)

View file

@ -268,7 +268,7 @@ const configSchema = {
appDir: {
type: 'boolean',
},
dangerouslyAllowMiddlewareResponseBody: {
allowMiddlewareResponseBody: {
type: 'boolean',
},
externalDir: {

View file

@ -79,7 +79,7 @@ export interface NextJsWebpackConfig {
}
export interface ExperimentalConfig {
dangerouslyAllowMiddlewareResponseBody?: boolean
allowMiddlewareResponseBody?: boolean
skipMiddlewareUrlNormalize?: boolean
skipTrailingSlashRedirect?: boolean
optimisticClientCache?: boolean

View file

@ -3,7 +3,7 @@ const nextConfig = {
experimental: {
skipTrailingSlashRedirect: true,
skipMiddlewareUrlNormalize: true,
dangerouslyAllowMiddlewareResponseBody: true,
allowMiddlewareResponseBody: true,
},
async redirects() {
return [

View file

@ -313,7 +313,7 @@ describe('AMP Usage', () => {
])
})
it('should detect the changes and display it', async () => {
it.skip('should detect the changes and display it', async () => {
let browser
try {
browser = await webdriver(dynamicAppPort, '/hmr/test')
@ -354,7 +354,7 @@ describe('AMP Usage', () => {
}
})
it('should detect changes and refresh an AMP page', async () => {
it.skip('should detect changes and refresh an AMP page', async () => {
let browser
try {
browser = await webdriver(dynamicAppPort, '/hmr/amp')
@ -383,7 +383,7 @@ describe('AMP Usage', () => {
}
})
it('should detect changes to component and refresh an AMP page', async () => {
it.skip('should detect changes to component and refresh an AMP page', async () => {
const browser = await webdriver(dynamicAppPort, '/hmr/comp')
await check(() => browser.elementByCss('#hello-comp').text(), /hello/)
@ -399,7 +399,7 @@ describe('AMP Usage', () => {
await check(() => browser.elementByCss('#hello-comp').text(), /hello/)
})
it('should not reload unless the page is edited for an AMP page', async () => {
it.skip('should not reload unless the page is edited for an AMP page', async () => {
let browser
const hmrTestPagePath = join(__dirname, '../', 'pages', 'hmr', 'test.js')
const originalContent = readFileSync(hmrTestPagePath, 'utf8')
@ -454,7 +454,7 @@ describe('AMP Usage', () => {
}
})
it('should detect changes and refresh a hybrid AMP page', async () => {
it.skip('should detect changes and refresh a hybrid AMP page', async () => {
let browser
try {
browser = await webdriver(dynamicAppPort, '/hmr/hybrid?amp=1')
@ -489,7 +489,7 @@ describe('AMP Usage', () => {
}
})
it('should detect changes and refresh an AMP page at root pages/', async () => {
it.skip('should detect changes and refresh an AMP page at root pages/', async () => {
let browser
try {
browser = await webdriver(dynamicAppPort, '/root-hmr')