Skip to content

Commit

Permalink
Fix generating coverage when all files skip-covered (#123)
Browse files Browse the repository at this point in the history
* fix parsing total line, by removing space

* 1.1.47

* changelog

* build
  • Loading branch information
MishaKav authored Mar 18, 2023
1 parent be8d9a4 commit 15eb264
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog of the Pytest Coverage Comment

## [Pytest Coverage Comment 1.1.47](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.47)

**Release Date:** 2023-03-18

#### Changes

- Fix generating coverage report when all files `skip-covered`

## [Pytest Coverage Comment 1.1.46](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.46)

**Release Date:** 2023-03-03
Expand Down
11 changes: 11 additions & 0 deletions data/pytest-coverage_12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.3, py-1.11.0, pluggy-0.13.1

---------- coverage: platform darwin, python 3.10.6-final-0 ----------
Name Stmts Miss Cover Missing
-------------------------------------
-------------------------------------
TOTAL 2922 0 100%

86 files skipped due to complete coverage.
Coverage XML written to file coverage.xml
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17047,7 +17047,7 @@ const getTotal = (data) => {
}

const lines = data.split('\n');
const line = lines.find((l) => l.includes('TOTAL '));
const line = lines.find((l) => l.includes('TOTAL '));

return parseTotalLine(line);
};
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.46",
"version": "1.1.47",
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
"author": "Misha Kav",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const getTotal = (data) => {
}

const lines = data.split('\n');
const line = lines.find((l) => l.includes('TOTAL '));
const line = lines.find((l) => l.includes('TOTAL '));

return parseTotalLine(line);
};
Expand Down

0 comments on commit 15eb264

Please sign in to comment.