Skip to content

Commit

Permalink
added retry logic to cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
tompahoward committed Jan 8, 2021
1 parent c9ab1ec commit 7328c5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs')

const FAIL_FAST = process.env.FAIL_FAST || '--fail-fast'
const NO_STRICT = process.env.NO_STRICT || ''
const RETRY = process.env.CI ? '--retry 5' : ''

const outputDirectory = 'test-results'
fs.mkdirSync(outputDirectory, { recursive: true })
Expand Down Expand Up @@ -39,7 +40,7 @@ function generateConfig () {
const REQUIRE_GLOB = 'src/test/**/*.js'
const CONFIG = `${FEATURE_GLOB} --format-options '${JSON.stringify(
FORMAT_OPTIONS
)}' ${MODULES} --require ${REQUIRE_GLOB} ${NO_STRICT} --format rerun:${RERUN} --format json:${resultsDirectory}/results.cucumber -f node_modules/cucumber-junit-formatter:${resultsDirectory}/results.xml ${FAIL_FAST}`
)}' ${MODULES} --require ${REQUIRE_GLOB} ${NO_STRICT} --format rerun:${RERUN} --format json:${resultsDirectory}/results.cucumber -f node_modules/cucumber-junit-formatter:${resultsDirectory}/results.xml ${RETRY} ${FAIL_FAST}`

console.log(CONFIG)
return CONFIG
Expand Down

0 comments on commit 7328c5f

Please sign in to comment.