Skip to content

Commit

Permalink
always stream smoke test logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed May 9, 2024
1 parent 1a3577f commit d2803f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
14 changes: 3 additions & 11 deletions smoke-tests/test/fixtures/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,11 @@ module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy
})

// In debug mode, stream stdout and stderr to console so we can debug hanging processes
if (debug) {
p.process.stdout.on('data', (c) => log('STDOUT: ' + c.toString().trim()))
p.process.stderr.on('data', (c) => log('STDERR: ' + c.toString().trim()))
}
p.process.stdout.on('data', (c) => log(c.toString().trim()))
p.process.stderr.on('data', (c) => log(c.toString().trim()))

const { stdout, stderr } = await p
// If not in debug mode, print full stderr and stdout contents separately
if (!debug) {
log(stderr)
log('-'.repeat(40))
log(stdout)
log('='.repeat(40))
}
log('='.repeat(40))

return { stderr, stdout }
}
Expand Down
4 changes: 1 addition & 3 deletions smoke-tests/test/npm-replace-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ t.test('publish and replace global self', async t => {
}).reply(201, {})
await npmLocal('publish', { proxy: true, force: true })

const paths = await npmInstall(npm, setup.SMOKE_PUBLISH ? {
tarballTimes: 2
} : {})
const paths = await npmInstall(npm)
t.equal(paths.npmRoot, join(globalNodeModules, 'npm'), 'npm root is in the testdir')
t.equal(paths.pathNpm, join(globalBin, 'npm'), 'npm bin is in the testdir')
t.equal(paths.pathNpx, join(globalBin, 'npx'), 'npx bin is in the testdir')
Expand Down

0 comments on commit d2803f3

Please sign in to comment.