Unverified Commit b4cc12e2 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Devlow: exit with non-zero code on failure (#73276)

This allows remaining variants/scenarios to run while still ensuring
that CI can recognize the failure.
parent 491e9c1a
...@@ -47,6 +47,11 @@ const nextBuildWorkflow = ...@@ -47,6 +47,11 @@ const nextBuildWorkflow =
__NEXT_TEST_MODE: '1', __NEXT_TEST_MODE: '1',
} }
const serverEnv = {
...env,
PORT: '0',
}
const benchmarkDir = resolve(REPO_ROOT, 'bench', benchDir) const benchmarkDir = resolve(REPO_ROOT, 'bench', benchDir)
// cleanup .next directory to remove persistent cache // cleanup .next directory to remove persistent cache
...@@ -88,7 +93,7 @@ const nextBuildWorkflow = ...@@ -88,7 +93,7 @@ const nextBuildWorkflow =
const startArgs = [turbopack ? 'start-turbopack' : 'start-webpack'] const startArgs = [turbopack ? 'start-turbopack' : 'start-webpack']
let shell = command('pnpm', startArgs, { let shell = command('pnpm', startArgs, {
cwd: benchmarkDir, cwd: benchmarkDir,
env, env: serverEnv,
}) })
const killShell = async () => { const killShell = async () => {
if (shell) { if (shell) {
...@@ -200,7 +205,7 @@ const nextBuildWorkflow = ...@@ -200,7 +205,7 @@ const nextBuildWorkflow =
// run command to start dev server // run command to start dev server
shell = command('pnpm', startArgs, { shell = command('pnpm', startArgs, {
cwd: benchmarkDir, cwd: benchmarkDir,
env, env: serverEnv,
}) })
// wait for server to be ready // wait for server to be ready
...@@ -222,7 +227,6 @@ const nextBuildWorkflow = ...@@ -222,7 +227,6 @@ const nextBuildWorkflow =
) )
await shell.reportMemUsage('mem usage after open page with cache') await shell.reportMemUsage('mem usage after open page with cache')
} catch (e) { } catch (e) {
console.log('CAUGHT', e)
throw e throw e
} finally { } finally {
// This must run in order // This must run in order
...@@ -278,11 +282,16 @@ const nextDevWorkflow = ...@@ -278,11 +282,16 @@ const nextDevWorkflow =
__NEXT_TEST_MODE: '1', __NEXT_TEST_MODE: '1',
} }
const serverEnv = {
...env,
PORT: '0',
}
// run command to start dev server // run command to start dev server
const args = [turbopack ? 'dev-turbopack' : 'dev-webpack'] const args = [turbopack ? 'dev-turbopack' : 'dev-webpack']
let shell = command('pnpm', args, { let shell = command('pnpm', args, {
cwd: benchmarkDir, cwd: benchmarkDir,
env, env: serverEnv,
}) })
const killShell = async () => { const killShell = async () => {
if (shell) { if (shell) {
...@@ -516,7 +525,7 @@ const nextDevWorkflow = ...@@ -516,7 +525,7 @@ const nextDevWorkflow =
// run command to start dev server // run command to start dev server
shell = command('pnpm', args, { shell = command('pnpm', args, {
cwd: benchmarkDir, cwd: benchmarkDir,
env, env: serverEnv,
}) })
// wait for server to be ready // wait for server to be ready
...@@ -537,9 +546,6 @@ const nextDevWorkflow = ...@@ -537,9 +546,6 @@ const nextDevWorkflow =
'lines' 'lines'
) )
await shell.reportMemUsage('mem usage after open page with cache') await shell.reportMemUsage('mem usage after open page with cache')
} catch (e) {
console.log('CAUGHT', e)
throw e
} finally { } finally {
// This must run in order // This must run in order
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
......
...@@ -57,6 +57,7 @@ export async function runScenarios( ...@@ -57,6 +57,7 @@ export async function runScenarios(
); );
} catch (e) { } catch (e) {
await fullIface.error(variant.scenario.name, variant.props, e); await fullIface.error(variant.scenario.name, variant.props, e);
process.exitCode = 1
} }
} }
......
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