1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

decrease coverage threshold that requires bump (#17544)

This commit is contained in:
Brad Decker 2023-02-02 16:43:55 -06:00 committed by GitHub
parent 02b2d7fa42
commit 14f3e16991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,8 @@ const codecovConfig = yaml.load(fs.readFileSync('codecov.yml', 'utf8'));
const COVERAGE_DIR = './coverage/';
const COVERAGE_THRESHOLD_FOR_BUMP = 1;
/**
* Load .json file at path and parse it into a javascript object
*
@ -113,12 +115,14 @@ function isCoverageInsufficient(target, actual) {
* @returns {boolean}
*/
function shouldCoverageBeBumped(target, actual) {
const lineCoverageNeedsBumped = actual.lines.pct > target.lines + 5;
const branchCoverageNeedsBumped = actual.branches.pct > target.branches + 5;
const lineCoverageNeedsBumped =
actual.lines.pct > target.lines + COVERAGE_THRESHOLD_FOR_BUMP;
const branchCoverageNeedsBumped =
actual.branches.pct > target.branches + COVERAGE_THRESHOLD_FOR_BUMP;
const functionCoverageNeedsBumped =
actual.functions.pct > target.functions + 5;
actual.functions.pct > target.functions + COVERAGE_THRESHOLD_FOR_BUMP;
const statementCoverageNeedsBumped =
actual.statements.pct > target.statements + 5;
actual.statements.pct > target.statements + COVERAGE_THRESHOLD_FOR_BUMP;
return (
lineCoverageNeedsBumped ||
branchCoverageNeedsBumped ||