Skip to content

Commit 2b75d58

Browse files
authored
Merge pull request #6377 from Shopify/better-errors-on-acceptance-tests
Improve logs for acceptance tests
2 parents aaf2747 + cf26271 commit 2b75d58

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

packages/features/lib/system.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ export function exec(command: string, args: string[] = [], options?: ExecOptions
2222

2323
const _options = {
2424
...options,
25-
stdout: undefined,
26-
stderr: undefined,
2725
env: {...process.env, ...(options?.env ?? {}), SHOPIFY_RUN_AS_USER: '0'},
2826
}
2927
const shortCommand = command.split('/').slice(-1).pop() || ''
3028
const commandProcess = execa(command, args, _options)
31-
commandProcess.stdout?.on('data', (data: string) => {
32-
if (isDebug) {
33-
console.log(colors.gray(`${colors.bold(shortCommand)}: ${data}`))
34-
}
35-
})
36-
commandProcess.stderr?.on('data', (data: string) => {
37-
if (isDebug) {
38-
console.log(colors.gray(`${colors.bold(shortCommand)}: ${data}`))
39-
}
40-
})
29+
30+
if (isDebug && commandProcess.stdout) {
31+
commandProcess.stdout.on('data', (data: Buffer) => {
32+
console.log(colors.gray(`${colors.bold(shortCommand)}: ${data.toString()}`))
33+
})
34+
}
35+
if (isDebug && commandProcess.stderr) {
36+
commandProcess.stderr.on('data', (data: Buffer) => {
37+
console.log(colors.gray(`${colors.bold(shortCommand)}: ${data.toString()}`))
38+
})
39+
}
40+
4141
return commandProcess
4242
}

packages/features/steps/app.steps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ async function generateExtension({name, type, directory, extraArgs, env}: Genera
123123
],
124124
{env},
125125
)
126-
// eslint-disable-next-line no-catch-all/no-catch-all
127-
} catch {
128-
assert.ok(true)
126+
} catch (error) {
127+
console.error(`Failed to generate extension: ${name} of type ${type}`, error)
128+
throw error
129129
}
130130
}

0 commit comments

Comments
 (0)