Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 14, 2022
1 parent 08003d2 commit 4f99a76
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 104 deletions.
49 changes: 0 additions & 49 deletions .github/actions/next-stats-action/src/run/index.js
Expand Up @@ -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}`)
Expand Down
File renamed without changes.
58 changes: 3 additions & 55 deletions 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)',
Expand Down Expand Up @@ -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',
Expand All @@ -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: `
Expand Down Expand Up @@ -142,37 +125,11 @@ module.exports = {
benchOptions: {
reqTimeout: 60,
concurrency: 50,
numRequests: 1000,
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: [
Expand Down Expand Up @@ -202,15 +159,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: 1000,
},
},
],
}

0 comments on commit 4f99a76

Please sign in to comment.