Skip to content

Tests: fix variety of broken covers tags#22126

Merged
jrfnl merged 6 commits intotrunkfrom
JRF/tests-fix-covers-tags
Mar 21, 2025
Merged

Tests: fix variety of broken covers tags#22126
jrfnl merged 6 commits intotrunkfrom
JRF/tests-fix-covers-tags

Conversation

@jrfnl
Copy link
Copy Markdown
Contributor

@jrfnl jrfnl commented Mar 21, 2025

Context

  • Code consistency

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a variety of broken @covers tags.

Relevant technical choices:

Tests: fix/remove invalid @covers tags

Tests: remove invalid @covers tags

Referenced method doesn't exist.

Also test classes should not have both @coversDefaultClass + @covers ::method AND a @covers ClassName at class level.

Tests: replace invalid @covers tag

Tests: fix invalid @covers tags

Tests: remove invalid @covers tags

Having a method level @covers ::method tag only works if there is also a class level @coversDefaultClass.

As these tests have class level @covers tags, Let's remove the invalid ones (which now try to point to global function which don't exist).

Tests: fix some incorrect @covers tags

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • N/A

jrfnl added 5 commits March 21, 2025 16:11
Referenced method doesn't exist.

Also test classes should not have both `@coversDefaultClass` + `@covers ::method` AND a `@covers ClassName` at class level.
Having a method level `@covers ::method` tag only works if there is also a class level `@coversDefaultClass`.

As these tests have class level `@covers` tags, Let's remove the invalid ones (which now try to point to global function which don't exist).
@jrfnl jrfnl added yoast cs/qa changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Mar 21, 2025
@jrfnl jrfnl added this to the 24.9 milestone Mar 21, 2025
@jrfnl jrfnl force-pushed the JRF/tests-fix-covers-tags branch from 3da7cbb to 1fe2254 Compare March 21, 2025 15:18
@jrfnl jrfnl merged commit 482bf7b into trunk Mar 21, 2025
27 checks passed
@jrfnl jrfnl deleted the JRF/tests-fix-covers-tags branch March 21, 2025 15:39
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 3b280b1c4e1bbfda186bd73d68a3dd5c2c17f068

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 813 unchanged lines in 48 files lost coverage.
  • Overall coverage decreased (-2.6%) to 48.71%

Files with Coverage Reduction New Missed Lines %
src/services/indexables/indexable-version-manager.php 1 62.5%
src/editors/framework/seo/posts/abstract-post-seo-data-provider.php 2 0.0%
src/integrations/exclude-attachment-post-type.php 2 50.0%
src/integrations/exclude-oembed-cache-post-type.php 2 50.0%
src/integrations/watchers/indexable-author-archive-watcher.php 2 0.0%
src/integrations/watchers/indexable-post-meta-watcher.php 2 85.71%
src/editors/domain/seo/description.php 3 76.92%
src/editors/domain/seo/keyphrase.php 3 76.92%
src/editors/domain/seo/title.php 3 76.92%
src/exceptions/indexable/not-built-exception.php 3 0.0%
Totals Coverage Status
Change from base Build 38f7dd2dce3a4ed11b15cb7ae62a3f469d39a24e: -2.6%
Covered Lines: 16102
Relevant Lines: 33057

💛 - Coveralls

@jrfnl
Copy link
Copy Markdown
Contributor Author

jrfnl commented Mar 22, 2025

Note: the decrease in code coverage is as expected as invalid coverage tags cause the test to record coverage for everything touched, instead of the coverage being limited to what is being tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog yoast cs/qa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants