CodeceptJS
CodeceptJS copied to clipboard
run-workers exits successfully despite test failures when using mocha-junit-reporter
Expected
Using the run-workers subcommand will return a non-zero exit code if any tests fail, regardless of reporter used.
Actual
run-workers exits with code 0 even if there are test failures when using mocha-junit-reporter
Console Output
yarn run v1.22.18
$ codeceptjs run-workers --suites 8 --reporter mocha-junit-reporter
CodeceptJS v3.3.0
Running tests in 8 workers...
context
[01] ✔ Log in as an Administrator in 15873ms
[01] ✖ Log in as a regular User in 22165ms
OK | 0 passed // 44s
✨ Done in 46.36s.
Process finished with exit code 0
Details
- CodeceptJS version:
3.3.0 - NodeJS Version:
16.14.2 - Operating System:
macOS Monterey 12.3.1 - Configuration file:
const { register } = require('ts-node')
const { setBrowser, setCommonPlugins, setHeadlessWhen, setTestHost } = require('@codeceptjs/configure')
register({
projectSearchDir: 'tests'
})
const { users } = require('./tests/config/plugins/autoLogin.ts')
const productionHost = 'https://example.com'
setBrowser(process.env.BROWSER ?? 'chromium')
setHeadlessWhen(process.env.HEADLESS)
setTestHost(process.env.TESTHOST ?? productionHost)
setCommonPlugins()
exports.config = {
name: 'ui-tests',
tests: 'tests/ui/**/*.test.ts',
output: 'tests/output',
helpers: {
Playwright: {
show: true,
waitForTimeout: 15_000
}
},
plugins: {
retryFailedStep: {
enabled: true
},
autoLogin: {
enabled: true,
inject: 'loginAs',
users
}
},
mocha: {
reporterOptions: {
stdout: 'tests/output/console.log',
mochaFile: 'tests/output/test-results.xml',
'mocha-junit-reporter': {
options: {
attachments: true
}
}
}
}
}
This issue is stale because it has been open for 90 days with no activity.
Same issue here. npx codeceptjs run-workers 3 If some tests failed, Im getting this:
[02] ✖ Тестирование логина и логаута @smoke @C8 in 8302ms
[01] ✔ Переход в профайл игрока заполнение данных для игрока с регистрацией через телефон @smoke @C27 in 61651ms
[01] ✔ История выводов @smoke @C16 in 5920ms
OK | 0 passed // 6m
$ echo $?
0
Gitlab runner: green but should be red.
This issue is stale because it has been open for 90 days with no activity.