Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elapsed time in minutes #63

Merged
merged 4 commits into from Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions dist/index.js
Expand Up @@ -15113,9 +15113,11 @@ const getNotSuccessTest = (options) => {
// convert summary from junitxml to md
const toMarkdown = (summary, options) => {
const { errors, failures, skipped, tests, time } = summary;
const displayTime =
time > 60 ? `${(time / 60) | 0}m ${time % 60 | 0}s` : `${time}s`;
const table = `| Tests | Skipped | Failures | Errors | Time |
| ----- | ------- | -------- | -------- | ------------------ |
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
`;

if (options.xmlTitle) {
Expand Down Expand Up @@ -15219,7 +15221,9 @@ const getMultipleReport = (options) => {

if (hasXmlReports && summary) {
const { errors, failures, skipped, tests, time } = summary;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
const displayTime =
time > 60 ? `${(time / 60) | 0}m ${time % 60 | 0}s` : `${time}s`;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
`;
} else {
table += `
Expand Down
49 changes: 26 additions & 23 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "pytest-coverage-comment",
"version": "1.1.25",
"version": "1.1.26",
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
"author": "Misha Kav",
"license": "MIT",
Expand Down Expand Up @@ -28,9 +28,9 @@
"xml2js": "^0.4.23"
},
"devDependencies": {
"@vercel/ncc": "^0.33.3",
"eslint": "^8.11.0",
"prettier": "^2.5.1"
"@vercel/ncc": "^0.33.4",
"eslint": "^8.13.0",
"prettier": "^2.6.2"
},
"prettier": {
"semi": true,
Expand Down
4 changes: 3 additions & 1 deletion src/junitXml.js
Expand Up @@ -116,9 +116,11 @@ const getNotSuccessTest = (options) => {
// convert summary from junitxml to md
const toMarkdown = (summary, options) => {
const { errors, failures, skipped, tests, time } = summary;
const displayTime =
time > 60 ? `${(time / 60) | 0}m ${time % 60 | 0}s` : `${time}s`;
const table = `| Tests | Skipped | Failures | Errors | Time |
| ----- | ------- | -------- | -------- | ------------------ |
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
`;

if (options.xmlTitle) {
Expand Down
4 changes: 3 additions & 1 deletion src/multiFiles.js
Expand Up @@ -83,7 +83,9 @@ const getMultipleReport = (options) => {

if (hasXmlReports && summary) {
const { errors, failures, skipped, tests, time } = summary;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${time}s :stopwatch: |
const displayTime =
time > 60 ? `${(time / 60) | 0}m ${time % 60 | 0}s` : `${time}s`;
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
`;
} else {
table += `
Expand Down