feat(travis-tests): dont stop on first failure on master

This commit is contained in:
Julien Fontanet 2020-09-10 16:42:41 +02:00
parent 14c3fa4378
commit 12c774a34a
2 changed files with 15 additions and 14 deletions

View File

@ -73,11 +73,11 @@
"dev-test": "jest --bail --watch \"^(?!.*\\.integ\\.spec\\.js$)\"", "dev-test": "jest --bail --watch \"^(?!.*\\.integ\\.spec\\.js$)\"",
"docs:dev": "vuepress dev docs", "docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs", "docs:build": "vuepress build docs",
"posttest": "scripts/run-script test",
"pretest": "eslint --ignore-path .gitignore .",
"prettify": "prettier --ignore-path .gitignore --write '**/*.{js,jsx,md,mjs,ts,tsx}'", "prettify": "prettier --ignore-path .gitignore --write '**/*.{js,jsx,md,mjs,ts,tsx}'",
"test": "jest \"^(?!.*\\.integ\\.spec\\.js$)\"", "test": "npm run test-lint && npm run test-unit",
"test-integration": "jest \".integ\\.spec\\.js$\"", "test-integration": "jest \".integ\\.spec\\.js$\"",
"test-lint": "eslint --ignore-path .gitignore .",
"test-unit": "jest \"^(?!.*\\.integ\\.spec\\.js$)\" && scripts/run-script test",
"travis-tests": "scripts/travis-tests" "travis-tests": "scripts/travis-tests"
}, },
"workspaces": [ "workspaces": [

View File

@ -2,12 +2,8 @@
const { execFileSync, spawnSync } = require('child_process') const { execFileSync, spawnSync } = require('child_process')
const run = (command, args) => { const run = (command, args) =>
const { status } = spawnSync(command, args, { stdio: 'inherit' }) spawnSync(command, args, { stdio: 'inherit' }).status
if (status !== 0) {
process.exit(status)
}
}
const getFiles = () => const getFiles = () =>
execFileSync( execFileSync(
@ -30,12 +26,17 @@ const getFiles = () =>
if (process.env.TRAVIS_PULL_REQUEST !== 'false') { if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
const files = getFiles().filter(_ => _.endsWith('.js')) const files = getFiles().filter(_ => _.endsWith('.js'))
if (files.length !== 0) { if (files.length !== 0) {
run( process.exit(
'./node_modules/.bin/jest', run(
['--findRelatedTests', '--passWithNoTests'].concat(files) './node_modules/.bin/jest',
['--findRelatedTests', '--passWithNoTests'].concat(files)
)
) )
} }
} else { } else {
run('yarn', ['test']) process.exit(
run('yarn', ['test-integration']) run('yarn', ['test-lint']) +
run('yarn', ['test-unit']) +
run('yarn', ['test-integration'])
)
} }