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

Deprecate includeUncoveredFiles configuration option #5951

Closed
nostadt opened this issue Sep 18, 2024 · 2 comments
Closed

Deprecate includeUncoveredFiles configuration option #5951

nostadt opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/configuration/xml feature/test-runner CLI test runner type/backward-compatibility Something will be/is intentionally broken
Milestone

Comments

@nostadt
Copy link

nostadt commented Sep 18, 2024

Hi Sebastian,

before I start, I want to give my appreciation for the time and effort you put into this project.

In the code coverage section (v11.3) of the documentation it is mentioned that it is highly recommended to keep the default (true) for includeUncoveredFiles. Otherwise the report is not complete and honest. That made me wonder, why can I disable it at all? Perhaps it can be removed, with the goal to reduce complexity.

Looking forward to hearing from you,

Alexander

@sebastianbergmann
Copy link
Owner

That made me wonder, why can I disable it at all? Perhaps it can be removed, with the goal to reduce complexity.

Good question and excellent point. Thank you for raising it!

Before php-code-coverage used static analysis (using PHP-Parser) to (also) analyse uncovered files, uncovered files were actually loaded using require. This resulted in any code outside of code units such as classes or functions to be executed. This in turn could cause problems and was the reason why it was made optional whether uncovered files should be processed or not.

So, yes, the includeUncoveredFiles option could have been removed a while ago.

@sebastianbergmann sebastianbergmann self-assigned this Sep 18, 2024
@sebastianbergmann sebastianbergmann added type/backward-compatibility Something will be/is intentionally broken feature/test-runner CLI test runner feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/configuration/xml labels Sep 18, 2024
@sebastianbergmann sebastianbergmann changed the title Question: Can the configuration setting "includeUncoveredFiles" be removed? Deprecate includeUncoveredFiles configuration option Sep 18, 2024
@sebastianbergmann sebastianbergmann added this to the PHPUnit 11.5 milestone Sep 18, 2024
@nostadt
Copy link
Author

nostadt commented Sep 18, 2024

You're welcome. Thank you for the response and happy to hear that it can be removed nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/configuration/xml feature/test-runner CLI test runner type/backward-compatibility Something will be/is intentionally broken
Projects
None yet
Development

No branches or pull requests

2 participants