diff --git a/.github/actions/next-stats-action/src/prepare/load-stats-config.js b/.github/actions/next-stats-action/src/prepare/load-stats-config.js index 7dfdfec22fe89..55cecb54faad3 100644 --- a/.github/actions/next-stats-action/src/prepare/load-stats-config.js +++ b/.github/actions/next-stats-action/src/prepare/load-stats-config.js @@ -16,7 +16,10 @@ function loadStatsConfig() { 'stats-config.js' )) break - } catch (_) { + } catch (err) { + if (err.code !== 'MODULE_NOT_FOUND') { + console.error('Failed to load stats-config at', configPath, err) + } /* */ } } diff --git a/.github/actions/next-stats-action/src/run/index.js b/.github/actions/next-stats-action/src/run/index.js index 5e332d4c9f6b2..2f0e053c35c78 100644 --- a/.github/actions/next-stats-action/src/run/index.js +++ b/.github/actions/next-stats-action/src/run/index.js @@ -169,55 +169,6 @@ async function runConfigs( ) ) curStats.General.buildDurationCached = Date.now() - secondBuildStart - - if (statsConfig.appDevCommand) { - const port = await getPort() - const startTime = Date.now() - const child = exec.spawn(statsConfig.appDevCommand, { - cwd: statsAppDir, - env: { - PORT: port, - }, - stdio: 'pipe', - }) - - let serverReadyResolve - let serverReadyResolved = false - const serverReadyPromise = new Promise((resolve) => { - serverReadyResolve = resolve - }) - - child.stdout.on('data', (data) => { - if ( - data.toString().includes('started server') && - !serverReadyResolved - ) { - serverReadyResolved = true - serverReadyResolve() - } - process.stdout.write(data) - }) - child.stderr.on('data', (data) => process.stderr.write(data)) - - child.on('exit', (code) => { - if (!serverReadyResolved) { - serverReadyResolve() - serverReadyResolved = true - } - exitCode = code - }) - - setTimeout(() => { - if (!serverReadyResolved) { - child.kill() - } - }, 3 * 1000) - - await serverReadyPromise - child.kill() - - curStats['General']['nextDevReadyDuration'] = Date.now() - startTime - } } logger(`Finished running: ${config.title}`) diff --git a/test/.stats-app/image.js b/test/.stats-app/pages/image.js similarity index 100% rename from test/.stats-app/image.js rename to test/.stats-app/pages/image.js diff --git a/test/.stats-app/stats-config.js b/test/.stats-app/stats-config.js index fb95fd578e620..0081dda215e3d 100644 --- a/test/.stats-app/stats-config.js +++ b/test/.stats-app/stats-config.js @@ -1,12 +1,3 @@ -const fs = require('fs') -const path = require('path') -// this page is conditionally added when not testing -// in webpack 4 mode since it's not supported for webpack 4 -const imagePageData = fs.readFileSync( - path.join(__dirname, './image.js'), - 'utf8' -) - const clientGlobs = [ { name: 'Client Bundles (main, webpack)', @@ -84,17 +75,13 @@ module.exports = { title: 'Default Build', diff: 'onOutputChange', diffConfigFiles: [ - { - path: 'pages/image.js', - content: imagePageData, - }, { path: 'next.config.js', content: ` module.exports = { experimental: { appDir: true, - // remove after next stable relase (current v12.3.1) + // remove after next stable release (current v12.3.1) serverComponents: true, }, generateBuildId: () => 'BUILD_ID', @@ -110,10 +97,6 @@ module.exports = { // renames to apply to make file names deterministic renames, configFiles: [ - { - path: 'pages/image.js', - content: imagePageData, - }, { path: 'next.config.js', content: ` @@ -135,51 +118,22 @@ module.exports = { 'http://localhost:$PORT/link', 'http://localhost:$PORT/withRouter', ], - pagesToBench: [ - 'http://localhost:$PORT/', - 'http://localhost:$PORT/error-in-render', - ], - benchOptions: { - reqTimeout: 60, - concurrency: 50, - numRequests: 2500, - }, + // TODO: investigate replacing "ab" for this + // pagesToBench: [ + // 'http://localhost:$PORT/', + // 'http://localhost:$PORT/error-in-render', + // ], + // benchOptions: { + // reqTimeout: 60, + // concurrency: 50, + // numRequests: 2500, + // }, }, { - title: 'Default Build with SWC', - diff: 'onOutputChange', - diffConfigFiles: [ - { - path: 'pages/image.js', - content: imagePageData, - }, - { - path: 'next.config.js', - content: ` - module.exports = { - experimental: { - appDir: true, - // remove after next stable relase (current v12.3.1) - serverComponents: true - }, - generateBuildId: () => 'BUILD_ID', - swcMinify: true, - webpack(config) { - config.optimization.minimize = false - config.optimization.minimizer = undefined - return config - } - } - `, - }, - ], + title: 'Default Build with SWC minify', // renames to apply to make file names deterministic renames, configFiles: [ - { - path: 'pages/image.js', - content: imagePageData, - }, { path: 'next.config.js', content: ` @@ -202,15 +156,6 @@ module.exports = { 'http://localhost:$PORT/link', 'http://localhost:$PORT/withRouter', ], - pagesToBench: [ - 'http://localhost:$PORT/', - 'http://localhost:$PORT/error-in-render', - ], - benchOptions: { - reqTimeout: 60, - concurrency: 50, - numRequests: 2500, - }, }, ], }