-
Notifications
You must be signed in to change notification settings - Fork 104
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
Unit tests lack code coverage reporting and @covers annotations #1284
Comments
@sarthak-19 @thelovekesh Since the Performance repo is a monorepo of plugins, and since PHPUnit is going to be run separately for each plugin and thus there will be multiple coverage files, does this mean there could be multiple coverage reports? I think that would be somewhat helpful if each plugin's coverage was reported separately, although this for me is only a nice-to-have. |
Yes @westonruter, that should be achievable. |
ProblemI managed to run the test locally and created a coverage-report.xml, previously report was not getting generated that's why one test was failing. But for testing purpose when I pushed the code to my draft PR, all the test is failing. ReasonFor PHP 8.1^ it's failing because PHPUnit 10 is getting used instead of 9, and for below 8.1 PHP I'm not able to understand why it's failing.
Questions
When testing locally, each plugin report was getting generated but was getting replaced due to same file name, so how can I set different file name for each plugin? cc : @westonruter @thelovekesh |
Here's how the AMP plugin configures specific PHPUnit versions: I'm not sure that's what we should do here as well. |
Currently all the tests are being run together via performance/.github/workflows/php-test-plugins.yml Lines 74 to 87 in 83b2117
This Line 54 in 83b2117
Lines 117 to 127 in 83b2117
So I think the workflow just needs to invoke each of the plugins' test commands separately: Lines 57 to 65 in 83b2117
|
Feature Description
In looking at
plugins/webp-uploads/tests/test-load.php
, I noticed most of the tests lack@covers
annotations. We should add those throughout our unit tests to better keep track of the code being tested. We should also add code coverage reporting for the repo (with Codecov). Thephpunit
calls incomposer.json
should also add--strict-coverage
to report warnings when@covers
tags are wrong.The text was updated successfully, but these errors were encountered: