Skip to content

Commit 52457cf

Browse files
authored
fix: prevent coverage threshold failures in CI (#490)
This PR adds a step to the codecov workflow that resets all coverage thresholds to empty objects before running tests. This ensures that the codecov job never fails due to coverage thresholds not being met, allowing it to simply collect and report coverage data to codecov. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 9aa42ef commit 52457cf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projenrc/codecov.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export class CodeCovWorkflow extends Component {
4040
name: 'Install dependencies',
4141
run: 'yarn install',
4242
},
43+
{
44+
name: 'Reset coverage thresholds',
45+
run: 'find . -name "jest.config.json" -type f -exec chmod +w {} \\; -exec node -e "const fs=require(\'fs\'); const file=process.argv[1]; const data=JSON.parse(fs.readFileSync(file)); data.coverageThreshold={ }; fs.writeFileSync(file, JSON.stringify(data, null, 2));" {} \\;',
46+
},
4347
{
4448
name: 'Build and test CLI',
4549
// The 'build' job includes running tests

0 commit comments

Comments
 (0)