Skip to content

Commit

Permalink
Revert changes to test for flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-brian-l committed Sep 13, 2024
1 parent 635e628 commit 6cba723
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 4 additions & 0 deletions lib/command/run-rerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module.exports = async function (test, options) {
const testRoot = getTestRoot(configFile)
createOutputDir(config, testRoot)

function processError(err) {
printError(err)
process.exit(1)
}
const codecept = new Codecept(config, options)

try {
Expand Down
1 change: 0 additions & 1 deletion lib/rerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class CodeceptRerunner extends BaseCodecept {
await this.runTests(test);
} catch (e) {
output.error(e.stack);
throw e;
} finally {
event.emit(event.all.result, this);
event.emit(event.all.after, this);
Expand Down
14 changes: 0 additions & 14 deletions test/runner/run_rerun_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,4 @@ describe('run-rerun command', () => {
},
)
})

it('should throw exit code 1 if all tests were supposed to pass', (done) => {
exec(
`FAIL_ATTEMPT=0 ${codecept_run_config('codecept.conf.pass_all_test.js', '@RunRerun - fail second test')} --debug`,
(err, stdout) => {
expect(stdout).toContain('Process run 1 of max 3, success runs 1/3')
expect(stdout).toContain('Fail run 2 of max 3, success runs 1/3')
expect(stdout).toContain('Process run 3 of max 3, success runs 2/3')
expect(stdout).toContain('Flaky tests detected!')
expect(err.code).toBe(1)
done()
},
)
})
})

0 comments on commit 6cba723

Please # to comment.