Problem/Motivation

Currently all *.api.php file is part of the code coverage report, and they are 100% red, because they are there only for documentation purposes.

Proposed resolution

Add exclude filters to ./core/phpunit.xml.dist file.

Remaining tasks

Do it.

Issue fork drupal-3252355

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Sweetchuck created an issue. See original summary.

sweetchuck’s picture

Status: Active » Needs review
StatusFileSize
new735 bytes
sweetchuck’s picture

StatusFileSize
new1.04 KB

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs review » Postponed (maintainer needs more info)
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Not sure I see the "why" this should be done.
Could you elaborate more

sweetchuck’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new70.94 KB

- What is the purpose of the test coverage report?
- It is intended to help identify areas of the system that have not been adequately tested, and to provide guidance on which tests should be conducted next.

Not everything has to be covered with Unit or Kernel tests.
Maybe a certain part of the code is covered with FunctionalJavascript test, but for that is very difficult to get coverage report.
It is also true if a file is 100% green, it doesn't mean that it is covered with right and meaningful tests.

Do we need to write test to cover the functions in any *.api.php files?
Can we write test to cover the functions in any *.api.php files?

If the answer is "no", then why are those files in the coverage report?

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new121 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

sweetchuck’s picture

Title: Add a whitelist filter to phpunit.xml.dist to exclude *.api.php files » Add filter rules to phpunit.xml.dist to exclude *.api.php files

sweetchuck’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Thank you for the explanation. Will see what the committers think.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 433faff and pushed to 10.1.x. Thanks!

  • catch committed 433faff8 on 10.1.x
    Issue #3252355 by Sweetchuck: Add filter rules to phpunit.xml.dist to...
catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.