Skip to content

Commit

Permalink
[ci-visibility] Add flags to force code coverage reporting and test s…
Browse files Browse the repository at this point in the history
…kipping (#3767)
  • Loading branch information
juan-fernandez committed Nov 8, 2023
1 parent 56ed58f commit 17fa54d
Showing 1 changed file with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,25 @@ function getItrConfiguration ({
try {
const {
data: {
attributes: {
code_coverage: isCodeCoverageEnabled,
tests_skipping: isSuitesSkippingEnabled
}
attributes
}
} = JSON.parse(res)
const config = { isCodeCoverageEnabled, isSuitesSkippingEnabled }
log.debug(() => `Received settings: ${config}`)
done(null, config)

let isCodeCoverageEnabled = attributes.code_coverage
let isSuitesSkippingEnabled = attributes.tests_skipping

log.debug(() => `Remote settings: ${{ isCodeCoverageEnabled, isSuitesSkippingEnabled }}`)

if (process.env.DD_CIVISIBILITY_DANGEROUSLY_FORCE_COVERAGE) {
isCodeCoverageEnabled = true
log.debug(() => 'Dangerously set code coverage to true')
}
if (process.env.DD_CIVISIBILITY_DANGEROUSLY_FORCE_TEST_SKIPPING) {
isSuitesSkippingEnabled = true
log.debug(() => 'Dangerously set test skipping to true')
}

done(null, { isCodeCoverageEnabled, isSuitesSkippingEnabled })
} catch (err) {
done(err)
}
Expand Down

0 comments on commit 17fa54d

Please sign in to comment.