-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Since v10 some lines are ignores #1022
Comments
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
The source is linked, ie. lines l37 - l39, it seems the issue is when the if expression is CTE (compile time evalueable). |
I see that the source is linked, but it's very cumbersome to reproduce locally, I didn't manage to achieve the result. @mvorisek can you provide the least amount of files that reproduce the issue in a separate repo please? |
I belive the reason you was not able to reproduce it is you did not run phpunit /w opcache. I belive so as Please run phpunit /w opcache like: The following code should be then enough to reproduce:
|
I did not realize that this is related to bytecode optimization before. I would argue that code coverage data should not be collected/processed when OpCache is active. We should probably error out when code coverage reporting is requested and OpCache is active. |
Thankfully, opcache is generally supported and we need it for other testing (memory leaks testing). I belive @Slamdunk can fix this as in v9 it was working. |
@mvorisek the repo doesn't provide all the necessary requirements for the test to run locally, I get many unrelated errors like:
Can you provide some Docker based reproducible environment please? |
#1022 (comment) this few lines should be enough - no other repo/files should be needed |
Please confim me you get l38 uncovered - ie. not uncounted/unmeasured - with v10 and opcache enabled, if so, I will provide a repro. |
I get L38 counted and uncovered |
@mvorisek Can you share your OpCache settings, please? Thanks! |
@Slamdunk thank you - one more check - l37 must be of course covered (in #1022 (comment) screenshot), ie. please run the test and confirm the previous. |
L37 is uncovered because I am not able to run the test suite locally, so... |
Here is a full repro: https://github.com/atk4/ui/tree/repro_coverage_1022 https://github.com/atk4/ui/blob/repro_coverage_1022/src/Repro/Repro.php and https://github.com/atk4/ui/blob/repro_coverage_1022/tests/JsTest.php files are enough to reproduce opcache config: nothing special, no JIT, just enabled opcache for CLI |
Running that branch locally I found:
But @mvorisek you stated that it was working on |
deps of atk4/ui@cb8e2d0 (after upgrade): https://github.com/atk4/ui/actions/runs/6996994492/job/19033470295#step:7:20 [1] coverage after upgrade: https://app.codecov.io/gh/atk4/ui/commit/cb8e2d02e92242f1affafaa4810691fe3da502c8/blob/tests/JsTest.php#L38 in the coverage pages, there is possible to download the uploaded data: [1]
[2]
|
Aaaaand... how do I reproduce this locally? I hope may come the day that I don't ask this question ever again 🙏 |
Is it relevant? The issue is l38 is uncounted and you was able to reproduce it. Let's focus on the fix. |
Of course it is relevant. How is @Slamdunk supposed to fix a bug that he cannot reproduce locally? |
As far as I can tell, this issue is not linked to #964 I was trying to help you looking for when the issue was introduced, but I can only search for it if I can reproduce it locally. I'm happy though that for you this is not relevant: ping us when you fix it by yourself then 👍 |
In #1022 (comment) you have written:
so what else input/repro you need? This is what is expected - if line green, code inside if red (not blank/not uncovered). If lines generated by #964 are missing in coverage output in general, they must be red/uncovered, not ignored. |
Those 2 lines have always been missing from CC with opcache active. Your bug only appeared recently. If you want your bug to be solved, I'm afraid I am unable to.
I am sorry I can't help any further; I have already spent all the free time I am willing to on this topic. |
I tried to help with the information in v9 it was working. However, I do not know myself why (even after a few experiments), but it seems the issue was also in v9. Let's please do not insist on this. Let's please acknowledge the issue is present and let's focus on the fix. |
source: https://github.com/atk4/ui/blob/5.0.0/tests/JsTest.php#L38
Started to happen when PHPUnit was upgraded to v10 and php-code-coverage from v9.2.29 to v10.1.9 on the same PHP version and xdebug version. See the screenshot, l38 went from uncovered to ignored.
The text was updated successfully, but these errors were encountered: