Closed (fixed)
Project:
Scheduler
Version:
2.x-dev
Component:
Testing
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 May 2025 at 13:45 UTC
Updated:
23 Sep 2025 at 19:29 UTC
Jump to comment: Most recent
In Core 11.2-dev #3497431: Deprecate TestDiscovery test file scanning, use PHPUnit API instead was introduced, but broke Contrib testing and has been reverted.
This has now been fixed, and re-committed to 11.2.x so the tests run, but give deprecation warnings about missing attribute metadata.
Add #[Group('scheduler')] (or the appropriate group) to each phpunit test classes.
Add #[DataProvider(' ... ')] to each dataprovider function.
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
Comment #4
jonathan1055 commentedNeed to remove the 3rd-party deprecation warnings so that we can see what actually needs to be done for Scheduler. Initial results as-is before any work, split by test @group:
scheduler- 23 tests triggered deprecations (all range between 54 and 74 deps) = too many add up accurately. Log is 41K linesscheduler_api, 63 + 58 + 59 + 54 = 234 deprecations, log is 8K linesscheduler_js- each test triggered 54 deprecations. Log is 3K, not too big.scheduler_kernel- each test triggered 7-9 deprecations. Log 890 lines.scheduler_rules_integration- each test triggered between 67-74 deprecations. Log is 8K linesscheduler_workbench- 68 deprecations. Log 1300 lines.Comment #5
jonathan1055 commentedFirst round of 3rd-party ignores. Big improvements made:
scheduler- 23 tests triggered deprecations (12-15 deps each). Log is 12K linesscheduler_api, each 12 - 13 deprecations, log is 2,900 linesscheduler_js- each test triggered 11 deprecations. Log is 1,500scheduler_kernel- each test triggered 7-9 deprecations. Log 890 lines (no change).scheduler_rules_integration- each test triggered 16 deprecations. Log is 3,100 linesscheduler_workbench-2212 deprecations. Log 780 lines.ManyAll of these are for Scheduler.Comment #7
jonathan1055 commentedAfter adding group attributes for
scheduler_jsthe DefaultTime test shows:Before: There were 27 PHPUnit test runner deprecations
After: There were 18 PHPUnit test runner deprecations.
The 9 removed messages were all
Likewise the verticalTabs test had 36 before down to 27 after.
So that's good. Even though the
@group scheduler_jsis still in the doc-comment, providing there is also the new#[Group('scheduler_js')]then the phpunit test runner deprecation is not displayed. That should mean we can fix the code for the new core 11.2+ and still support testing at the old core versions.Comment #8
mondrakeAs per #3497431-107: Deprecate TestDiscovery test file scanning, use PHPUnit API instead, you may opt-out from reporting PHPUnit runner deprecations (if they're too noisy for now), by setting the env variable
PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATIONto FALSE.Comment #9
jonathan1055 commentedThanks, yes that worked. After adding
#[DataProvider()]to go with each@dataProviderin the javascript tests we still had the messageThere were 9 PHPUnit test runner deprecationsfollowed by8 tests triggered 11 deprecations. The 9 were all for core functions, after I had fixed the project's own ones.https://git.drupalcode.org/project/scheduler/-/jobs/5598340#L663
With
PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION: 0we just get straight to8 tests triggered 11 deprecationshttps://git.drupalcode.org/project/scheduler/-/jobs/5599415#L661
Thanks also for raising #3530202: Introduce PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION
Comment #13
jonathan1055 commentedI have merged the main work MR242. This requied the new
PHPStan (previous Major)job to be skipped as the new attributes and classes have not been backported to Drupal 10. However, there should not be any problem with running on a Drupal 10 site, as the attribute classes will not be examined or used in any way.See this slack discussion on the subject. Specifically
Comment #15
jonathan1055 commented