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

add option --cov-summary to show coverage summary in terminal #140

Closed
wants to merge 1 commit into from

Conversation

flniu
Copy link

@flniu flniu commented Nov 13, 2016

In our case, we want to see a brief summary about the total coverage and required coverage in CI console, instead of printing a full term report or opening the html report. So I add an option --cov-summary to output coverage summary in terminal.

@ionelmc
Copy link
Member

ionelmc commented Nov 14, 2016

Wouldn't an addition to --cov-report be better? Eg: --cov-report=summary.

@flniu
Copy link
Author

flniu commented Nov 14, 2016

At first, I thought about --cov-report=term-summary, however:

  • The summary only includes total coverage and required coverage(optional); it's not much like a report.
  • I need to consider existing report types and handle the logic if no other --cov-report is specified.

So I choose an easier way which add an option but has the least impact on existing logic.

@ionelmc
Copy link
Member

ionelmc commented Nov 14, 2016

My two concerns are:

  • it doesn't really make sense to use both --cov-summary and --cov-report, as reports would show the total. The seem exclusive to me, that's why I suggested extending --cov-report.
  • I have a preference for not adding lots of switches and knobs. Perhaps always showing some sort of summary is acceptable (eg: if there's no --cov-report=term*)?

@flniu
Copy link
Author

flniu commented Nov 15, 2016

Well, I agree not to add lots of switches.

I thought about our requirement again. In current version, when --cov-fail-under is specified and required coverage is not reached, a message like this will be output:

FAIL Required test coverage of 80% not reached. Total coverage: 75%

What we need is: when required coverage is reached, also output a message like:

Required test coverage of 80% reached. Total coverage: 85%

How about this plan?

@ionelmc
Copy link
Member

ionelmc commented Nov 15, 2016

If you mean changing --cov-fail-under to always show summary and adding no other option then I like it.

@flniu
Copy link
Author

flniu commented Nov 16, 2016

Yes, that is what I mean. I'll work on it. This pr can be closed then.

@flniu flniu closed this Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants