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

'term:skip-covered' should be used in preference to 'term' #324

Open
wadetregaskis-linkedin opened this issue Nov 20, 2019 · 7 comments
Open

Comments

@wadetregaskis-linkedin
Copy link

wadetregaskis-linkedin commented Nov 20, 2019

In reporting to the terminal, the pertinent information is the missing coverage - I don't need to see a long list of files with 100% coverage. I still want that in the other reports, because e.g. my CI pipeline might set requirements on overall coverage - so I can't just put 'skip_covered = true' in my setup.cfg.

@wadetregaskis-linkedin wadetregaskis-linkedin changed the title term:missing should be used in preference to 'term' 'term:missing' should be used in preference to 'term' Nov 20, 2019
@warsaw
Copy link
Contributor

warsaw commented Nov 21, 2019

Can you just add

[report]
skip_covered=true

to your setup.cfg?

@wadetregaskis-linkedin
Copy link
Author

Unfortunately not - I tried that, but it applies to all reports, not just the one output to the terminal. That's what I was alluding to in my original comment here.

I also tried re-setting it to false specifically in the [coverage:html] et al sections, but unfortunately it's apparently not supported in those sections (evidently they're not logical 'subclasses' of the 'report' section).

@warsaw
Copy link
Contributor

warsaw commented Nov 21, 2019

Ah, sorry; you wrote skip_missing so that threw me off.

FWIW, I like the 100% coverage output.

Unfortunately, I'm not sure if what you want is supported by coverage.

@wadetregaskis-linkedin
Copy link
Author

Whoops! Sorry for the confusion. Properties - they're all the same, right? ;)

@wadetregaskis-linkedin
Copy link
Author

It is supported - AFAICT that's why 'term:missing' exists, as a special-case way to override skip_covered only for terminal output. It unfortunately appears to be the only way to do that, and I don't see any way to otherwise modify what the coverage pygradle plugin passes to pytest w.r.t. these parameters.

@warsaw warsaw changed the title 'term:missing' should be used in preference to 'term' 'term:covered' should be used in preference to 'term' Nov 21, 2019
@warsaw warsaw changed the title 'term:covered' should be used in preference to 'term' 'term:skip-covered' should be used in preference to 'term' Nov 21, 2019
@warsaw
Copy link
Contributor

warsaw commented Nov 21, 2019

FYI, this change would have to be made in PyCoverageTask.groovy:

    public void preExecution() {
        // using subArgs as these must be added after py.test
        subArgs(
            '--cov',
            project.file(component.srcDir).getAbsolutePath(),
            '--cov-report=xml',
            '--cov-report=html',
            '--cov-report=term'
        )

        super.preExecution()
    }

We would have to think about how to make this configurable since we still want to support --cov-report=term.

@wadetregaskis-linkedin
Copy link
Author

Agreed making it configurable would be wise. I have no objection if I have to explicitly turn this on within build.gradle or similar - so long as there's some way for me to do so.

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

No branches or pull requests

2 participants