Skip to content

Commit

Permalink
ignore files that didn't exists in multimode
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaKav committed Jun 19, 2021
1 parent 62195be commit bdda1db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12725,8 +12725,13 @@ const getMultipleReport = (options) => {
const coverage = getCoverageReport(internalOptions);
const summary = getParsedXml(internalOptions);

table += `| ${l.title} | ${coverage.html}`;
if (hasXmlReports) {
if (coverage.html) {
table += `| ${l.title} | ${coverage.html}`;
} else if (summary) {
table += `| ${l.title} | `;
}

if (hasXmlReports && summary) {
const { errors, failures, skipped, tests, time } = summary;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pytest-coverage-comment",
"version": "1.1.0",
"version": "1.1.1",
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
"author": "Misha Kav",
"license": "MIT",
Expand Down
9 changes: 7 additions & 2 deletions src/multiFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ const getMultipleReport = (options) => {
const coverage = getCoverageReport(internalOptions);
const summary = getParsedXml(internalOptions);

table += `| ${l.title} | ${coverage.html}`;
if (hasXmlReports) {
if (coverage.html) {
table += `| ${l.title} | ${coverage.html}`;
} else if (summary) {
table += `| ${l.title} | `;
}

if (hasXmlReports && summary) {
const { errors, failures, skipped, tests, time } = summary;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
`;
Expand Down

0 comments on commit bdda1db

Please sign in to comment.