@dragonshorn-studios/elyseum-cli 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -25024,13 +25024,25 @@ class GithubPRCommentCoverageReporter {
|
|
|
25024
25024
|
if (diffCoverage.lines.total) {
|
|
25025
25025
|
// lines, functions, branches average percentage must be greater than or equal to qualityGate
|
|
25026
25026
|
qualityGateFailed =
|
|
25027
|
-
diffCoverage.lines.percent
|
|
25028
|
-
|
|
25029
|
-
diffCoverage.
|
|
25027
|
+
(isNaN(diffCoverage.lines.percent)
|
|
25028
|
+
? false
|
|
25029
|
+
: diffCoverage.lines.percent < qualityGateFail) ||
|
|
25030
|
+
(isNaN(diffCoverage.functions.percent)
|
|
25031
|
+
? false
|
|
25032
|
+
: diffCoverage.functions.percent < qualityGateFail) ||
|
|
25033
|
+
(isNaN(diffCoverage.branches.percent)
|
|
25034
|
+
? false
|
|
25035
|
+
: diffCoverage.branches.percent < qualityGateFail);
|
|
25030
25036
|
qualityGateWarning =
|
|
25031
|
-
diffCoverage.lines.percent
|
|
25032
|
-
|
|
25033
|
-
diffCoverage.
|
|
25037
|
+
(isNaN(diffCoverage.lines.percent)
|
|
25038
|
+
? false
|
|
25039
|
+
: diffCoverage.lines.percent < qualityGate) ||
|
|
25040
|
+
(isNaN(diffCoverage.functions.percent)
|
|
25041
|
+
? false
|
|
25042
|
+
: diffCoverage.functions.percent < qualityGate) ||
|
|
25043
|
+
(isNaN(diffCoverage.branches.percent)
|
|
25044
|
+
? false
|
|
25045
|
+
: diffCoverage.branches.percent < qualityGate);
|
|
25034
25046
|
let coverageQualityText = ``;
|
|
25035
25047
|
if (qualityGate) {
|
|
25036
25048
|
if (qualityGateFailed) {
|
|
@@ -25042,15 +25054,15 @@ class GithubPRCommentCoverageReporter {
|
|
|
25042
25054
|
else {
|
|
25043
25055
|
coverageQualityText += `> [!TIP]\n> ### Coverage Quality Gate Passed 🟩\n`;
|
|
25044
25056
|
}
|
|
25045
|
-
coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent)} Lines: ${diffCoverage.lines.percent
|
|
25046
|
-
coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent)} Functions: ${diffCoverage.functions.percent
|
|
25047
|
-
coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent)} Branches: ${diffCoverage.branches.percent
|
|
25057
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} Lines: ${this.percentOrNA(diffCoverage.lines.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
|
|
25058
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} Functions: ${this.percentOrNA(diffCoverage.functions.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
|
|
25059
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} Branches: ${this.percentOrNA(diffCoverage.branches.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n\n`;
|
|
25048
25060
|
}
|
|
25049
25061
|
let summary = `| Type | Total | Covered | Percent |\n`;
|
|
25050
25062
|
summary += `|-----------|-------|---------|---------|\n`;
|
|
25051
|
-
summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent)} ${diffCoverage.lines.percent
|
|
25052
|
-
summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent)} ${diffCoverage.functions.percent
|
|
25053
|
-
summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent)} ${diffCoverage.branches.percent
|
|
25063
|
+
summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.lines.percent)} |\n`;
|
|
25064
|
+
summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.functions.percent)} |\n`;
|
|
25065
|
+
summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.branches.percent)} |\n`;
|
|
25054
25066
|
markdown += `### Coverage Summary\n\n${summary}`;
|
|
25055
25067
|
markdown += coverageQualityText;
|
|
25056
25068
|
let detailsTable = `\n<details>\n<summary>Coverage Details</summary>\n\n`;
|
|
@@ -25164,13 +25176,13 @@ class GithubPRCommentCoverageReporter {
|
|
|
25164
25176
|
fs$1.writeFileSync(annotationFilePath, JSON.stringify(checkData));
|
|
25165
25177
|
}
|
|
25166
25178
|
}
|
|
25167
|
-
getIcon(percent) {
|
|
25179
|
+
getIcon(percent, qualityGate, qualityGateFail) {
|
|
25168
25180
|
// emoji based
|
|
25169
|
-
if (percent >=
|
|
25181
|
+
if (percent >= qualityGate) {
|
|
25170
25182
|
// green circle
|
|
25171
25183
|
return "🟢";
|
|
25172
25184
|
}
|
|
25173
|
-
else if (percent >=
|
|
25185
|
+
else if (percent >= qualityGateFail) {
|
|
25174
25186
|
return "🟡";
|
|
25175
25187
|
}
|
|
25176
25188
|
else {
|