Use local AMP validator to reduce test flakiness (#63838)
We've seen test flakiness from the upstream AMP resource being unavailable so this pulls that resource to the repo and uses that instead. x-ref: [slack thread](https://vercel.slack.com/archives/C04KC8A53T7/p1711643629072819) Closes NEXT-2961
This commit is contained in:
parent
dfeb3d10ed
commit
3299fe0b3a
22 changed files with 4598 additions and 2 deletions
|
@ -39,3 +39,5 @@ packages/next-bundle-analyzer/index.d.ts
|
|||
examples/with-typescript-graphql/lib/gql/
|
||||
test/development/basic/hmr/components/parse-error.js
|
||||
packages/next-swc/docs/assets/**/*
|
||||
test/lib/amp-validator-wasm.js
|
||||
test/production/pages-dir/production/fixture/amp-validator-wasm.js
|
||||
|
|
|
@ -37,3 +37,5 @@ bench/nested-deps/components/**/*
|
|||
|
||||
**/convex/_generated/**
|
||||
**/.tina/__generated__/**
|
||||
test/lib/amp-validator-wasm.js
|
||||
test/production/pages-dir/production/fixture/amp-validator-wasm.js
|
||||
|
|
|
@ -13,3 +13,5 @@ pnpm-lock.yaml
|
|||
.github/actions/needs-triage/index.js
|
||||
.github/actions/*/index.mjs
|
||||
**/convex/_generated/**
|
||||
test/lib/amp-validator-wasm.js
|
||||
test/production/pages-dir/production/fixture/amp-validator-wasm.js
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
module.exports = {
|
||||
output: 'export',
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
// exportPathMap
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
optimizer: {
|
||||
ampRuntimeVersion: '001515617716922',
|
||||
rtv: true,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: 'https://cdn.ampproject.org/v0/validator_wasm.js',
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
7
test/integration/amphtml-fragment-style/next.config.js
Normal file
7
test/integration/amphtml-fragment-style/next.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
7
test/integration/amphtml-ssg/next.config.js
Normal file
7
test/integration/amphtml-ssg/next.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
|
@ -6,5 +6,10 @@ module.exports = {
|
|||
amp: {
|
||||
canonicalBase: 'http://localhost:1234',
|
||||
},
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
// edit here
|
||||
}
|
||||
|
|
|
@ -4,4 +4,9 @@ module.exports = {
|
|||
config.experiments.topLevelAwait = true
|
||||
return config
|
||||
},
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -7,4 +7,9 @@ module.exports = {
|
|||
'/ssr': { page: '/ssr', query: { another: 'one' } },
|
||||
}
|
||||
},
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,3 +1,8 @@
|
|||
module.exports = {
|
||||
output: 'export',
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
module.exports = { cleanDistDir: false }
|
||||
module.exports = {
|
||||
cleanDistDir: false,
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
module.exports = {
|
||||
cleanDistDir: false,
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
module.exports = {
|
||||
basePath: '/docs',
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
i18n: {
|
||||
// localeDetection: false,
|
||||
locales: [
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
module.exports = {
|
||||
// basePath: '/docs',
|
||||
// trailingSlash: true,
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
i18n: {
|
||||
// localeDetection: false,
|
||||
locales: [
|
||||
|
|
7
test/integration/page-config/next.config.js
Normal file
7
test/integration/page-config/next.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('../../lib/amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
}
|
1
test/lib/amp-readme.md
Normal file
1
test/lib/amp-readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
The `amp-validator-wasm.js` is used instead of the CDN as it isn't super reliable and causes test flakiness.
|
2254
test/lib/amp-validator-wasm.js
Normal file
2254
test/lib/amp-validator-wasm.js
Normal file
File diff suppressed because one or more lines are too long
2254
test/production/pages-dir/production/fixture/amp-validator-wasm.js
Normal file
2254
test/production/pages-dir/production/fixture/amp-validator-wasm.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,11 @@
|
|||
setInterval(() => {}, 250)
|
||||
|
||||
module.exports = {
|
||||
experimental: {
|
||||
amp: {
|
||||
validator: require.resolve('./amp-validator-wasm.js'),
|
||||
},
|
||||
},
|
||||
onDemandEntries: {
|
||||
// Make sure entries are not getting disposed.
|
||||
maxInactiveAge: 1000 * 60 * 60,
|
||||
|
|
Loading…
Reference in a new issue