From f45bd57f7440a25599615a34484c3d84d2ba7efe Mon Sep 17 00:00:00 2001 From: futpib Date: Mon, 2 Dec 2019 02:38:53 -0800 Subject: [PATCH] Use 'verbose' listr renderer in CI (#466) * Use 'verbose' listr renderer in CI (fixes #465) * skip coverage report on integration test * print stderr --- .travis.yml | 2 +- test/integration/test.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63fabed270..ef24806f83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,4 +16,4 @@ script: - if [[ $LINT == true ]]; then npm run lint; fi - if [[ $SKIP_TEST != true ]]; then npm test; fi after_success: - - if [[ $LINT != true ]]; then ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls; fi + - if [[ $SKIP_TEST != true ]]; then ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls; fi diff --git a/test/integration/test.js b/test/integration/test.js index ea0f823602..9157e5e892 100755 --- a/test/integration/test.js +++ b/test/integration/test.js @@ -6,6 +6,7 @@ const tempy = require('tempy'); const execa = require('execa'); const del = require('del'); const chalk = require('chalk'); +const {isCI} = require('ci-info'); const packages = new Map([ ['ava', 'https://github.com/avajs/ava'], @@ -130,7 +131,10 @@ const execute = name => { title: 'Clean up', task: () => del(destination, {force: true}) } - ], { + ].map(({title, ...task}) => ({ + title: [name, title].join(' / '), + ...task + })), { exitOnError: false }); }; @@ -157,7 +161,9 @@ const list = new Listr([ return tests; } } -]); +], { + renderer: isCI ? 'verbose' : 'default' +}); list.run() .catch(error => { @@ -165,6 +171,11 @@ list.run() for (const error2 of error.errors) { console.error('\n', chalk.red.bold.underline(error2.packageName), chalk.gray('(' + error2.cliArgs.join(' ') + ')')); console.error(error2.message); + + if (error2.stderr) { + console.error(chalk.gray(error2.stderr)); + } + if (error2.eslintMessage) { console.error(chalk.gray(error2.eslintFile.filePath), chalk.gray(JSON.stringify(error2.eslintMessage, null, 2))); }