Hey, I have been tasked with kitting out our Pipeline with the ability to fail a build/PR when test coverage is underneath a specific quota. I have read one of your articles which states this as a recommended practice (https://www.atlassian.com/continuous-delivery/introduction-to-code-coverage) but can't actually find any information on how to do it, would appreciate some understanding on this all.Thanks.
I'd really appreciate an answer on how I can fail my builds if coverage is under certain thresholds. I'm still looking for a way to do this.
Why has nobody answered this from Atlassian?
I too would like some clarity on this, is there documentation somewhere? Surely someone would have had an experience with this they can share, some tips or a pointer in the right direction.
@Louis Willcock @Mathew MorrisonIt took me while but it is now working for NodeJS project. Here is what you need to do:
"test": "nyc mocha"
nyc check-coverage --lines ${NYC_CHECK_COVERAGE}
After doing this when ever you create a PR that has coverage less than the value set in the environment variable will fail pipelines.Cheers.
It looks like you're new here. Sign in or register to get started.