-
Improvement
-
Resolution: Fixed
-
Major
-
3.11, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
Right now we are running phpunit 8.5.x (MDL-67673). It's time to bump to newer version.
This is a "clone" of that issue, with all the still open linked issues dragged here.
Candidates are, right now: (source link):
- 9.x: supports php 7.3, 7.4 and 8.0 (that aligns 100% with our supported PHP versions). Mid-size changes required. Fully supported till Feb 2022.
- 10.x: still not released. Not enough info right now. Maybe to be considered next year.
Because of a better alignment with Moodle 3.11 PHP supported versions (see ongoing work @ MDL-70745) this issue is about to upgrade to phpunit 9.5. Knowing that changes aren't trivial.
Sources of information:
- Release announcement: https://phpunit.de/announcements/phpunit-9.html
- Migrating to phpunit 9 post: https://thephp.cc/news/2020/02/migrating-to-phpunit-9
- Changes / deprecations in various PHPUnit releases, not documented above:
- PHPUnit 9.0: https://github.com/sebastianbergmann/phpunit/blob/9.0.0/ChangeLog-9.0.md
- PHPUnit 9.1: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md
- PHPUnit 9.3: https://github.com/sebastianbergmann/phpunit/blob/9.3.0/ChangeLog-9.3.md
- PHPUnit 9.5: https://github.com/sebastianbergmann/phpunit/blob/9.5.0/ChangeLog-9.5.md
- Attached summary created with all the info above, with the bits affecting us: phpunit95-progress.rtf
SUMMARY:
- Upgrade composer to the target phpunit version (link to procedure).
- Fullfill phpunit API required changes.
- Fix other incompatibilities detected.
- Add a note @ upgrade.txt, pointing to the docs (and maybe main points).
- Verify that the new code is passing against ALL php supported versions.
- Verify that behat continues passing without problem
- Verify that incomplete and skipped tests are shown using the -v[erbose]Â switch.
- Send the issue to peer-review, yay!
Some notes to reviewer(s).
- It's recommended to review the patch commit by commit. I've tried to introduce all the important information within each commit message.
- Don't become crazy about checking the hundreds of changes to assertions 1 by 1. PHPUnit execution will tell you if there is any change missing (will emit warning or failure). Better focus on commits with logic.
- Verify that there are commits corresponding to all the "DONE" points in the comment used to trace the progress.
TODO (after rolled upstream):
- Create a new section like this @ the development Moodle Docs, explaining the main differences and linking to complete information.
- Also fill this table with the new version just added.
- Document the coverage_info changes coming with this release. (link)
- blocks
-
MDL-37655 Update phpunit tests files where multiple test classes are defined
- Closed
- has a non-specific relationship to
-
MDL-70745 Prepare Moodle for PHP 8.0
- Closed
-
MDL-69308 Decide Moodle 3.11 requirements and push them to environment.xml (due date: 2020-12-21)
- Closed
- has been marked as being related by
-
MDL-70815 Create a base class for fetching a user's activity completion details
- Closed
-
MDL-81266 Bump behat and phpunit (composer) to current ones (PHP 8.3 / Moodle 4.4)
- Closed
-
MDL-71067 Final deprecation of whitelist properties in coverage_info
- Closed
- is a clone of
-
MDL-67673 Upgrade phpunit to 8.5.x
- Closed
- is duplicated by
-
MDL-70410 phpunit.xsd is still refering to ResultPrinter
- Closed
- Testing discovered
-
MDL-69885 Check non _test.php files containing PHPUnit assertions
- Open
-
MDL-69624 Running "question_engine_test" alone fails
- Closed
-
MDL-69688 Verify test_context_not_used unit test and fix it
- Closed
-
MDL-69700 Verify test_invalid_related / test_create_competency_with_nasty_data tests
- Closed
-
MDL-71049 Make test files and test classes to match to get phpunit able to run individual files
- Closed
-
MDL-37655 Update phpunit tests files where multiple test classes are defined
- Closed
- will help resolve
-
MDL-69709 Review phpunit_coverage_info and change $whitelistfolders
- Closed