Closed aspark21 closed 8 months ago
ties back to https://tracker.moodle.org/browse/MDL-71049
Yes, that will have broken the unit tests in this plugin. Please complain to Eloy in the tracker. If they moved base classes, they should have listed them as renamed classes.
Hi,
I tried not to rename base classes in stables but, obviously, it seems that some of them escaped to me. Surely when backporting or over the multiple (conflicting) weekly rebases I had to do with some of the branches, I'm afraid.
Problem with renamed classes (I remember I tried that with some other base class) is that they will emit debugging and surely will keep failing the unit tests.
And the alternative solution is about to re-introduce the original base classes, just extending the new ones. But this solution is not perfect either, because 4.1dev (master) won't get them re-introduced. So, if you are testing the same plugin codebase against multiple branches (like it seems that you are doing here, I can see 311 and master in the GHA workflow)... it will continue failing against master.
So I'm not sure how to proceed with this (core-wise) because no solution will work for plugins being tested against multiple core branches, unless the plugin, effectively, moves to the new base classes.
Uhm... I continue thinking about this... just sharing my first thoughts.
Ciao :-)
I annotate this here till there is an issue:
Ok, good news is that there are only 2 renamed/moved classes in 311_STABLE and only 1 in 400_STABLE potentially causing problems.
I've examined all test files changed since .0 release on every branch, removing those that haven't changed or that are core-core (not related with plugins or subplugins) and have got this:
git diff --name-only v3.11.0 MOODLE_311_STABLE | \
grep -P '_test.php|_testcase.php' | xargs grep -P '^class .*(_test|_testcase) extends .*' | \
grep -vP 'base_testcase|basic_testcase|advanced_testcase' | \
grep -vP 'restore_date_testcase|provider_testcase|data_privacy_testcase|cachestore_tests|messagelib_test' | \
grep -vP 'database_driver_testcase|core_reportbuilder_testcase|lti_advantage_testcase' | \
grep -vP 'mod_lti_testcase|repository_googledocs_testcase|googledocs_content_testcase' | \
grep -vP 'question_testcase|qbehaviour_walkthrough_test_base|question_attempt_upgrader_test_base' | \
grep -vP 'data_loading_method_test_base|all_checks|area_test_base|brickfield_accessibility_test'
git diff --name-only v4.0.0 MOODLE_400_STABLE | \
grep -P '_test.php|_testcase.php' | xargs grep -P '^class .*(_test|_testcase) extends .*' | \
grep -vP 'base_testcase|basic_testcase|advanced_testcase' | \
grep -vP 'restore_date_testcase|provider_testcase|data_privacy_testcase|cachestore_tests|messagelib_test' | \
grep -vP 'database_driver_testcase|core_reportbuilder_testcase|lti_advantage_testcase' | \
grep -vP 'mod_lti_testcase|repository_googledocs_testcase|googledocs_content_testcase' | \
grep -vP 'question_testcase|qbehaviour_walkthrough_test_base|question_attempt_upgrader_test_base' | \
grep -vP 'data_loading_method_test_base|all_checks|area_test_base|brickfield_accessibility_test'
Still thinking which is the best way to fix them... but at very least... they aren't legion.
Ciao :-)
Ok, some more background about the 2 cases found above:
\mod_assign\tests\mod_assign_privacy_testcase
\mod_quiz_attempt_walkthrough_from_csv_testcase
Now looking for known uses in pluginland... coming soon...
Edited, to fix links...
The following uses have been found in pluginland (examining all the checks that CiBoT runs against plugins):
So, I'm certainly becoming biased about just fix it here and forget this unfortunate incident...
Alternatively, 100% up to you, feel free to create MDL issue and we'll see there how to make the old 2 classes available there (surely extending in stables and maybe adding to renamedclasses in master, so it shows debugging info). Although, as said... there aren't more uses (publicly available and published) that the ones above.
Ciao :-)
Thanks for that research Eloy, in that case we will just fix it here.
Does it make sense to change: class qtype_varnumeric_statistics_from_steps_testcase extends mod_quiz_attempt_walkthrough_from_csv_testcase To: class qtype_varnumeric_statistics_from_steps_testcase extends \mod_quiz\attempt_walkthrough_from_csv_test
Which seems to fix this issue for me
nadav, that only works in 4.2, and this plugin supports mulitple Moodle versions from its master branch.
@timhunt , it works for me in 4.1, but I get your point.
I just pushed the latest OU code changes, which should have fixed this. Closing.
Started having the following errors in MOODLE_311_STABLE against main branch of this plugin in the last week.
Timing didn't seem to relate to changes within this plugin but found this change in core Moodle that will be the cause:
https://github.com/moodle/moodle/commit/65c883915788a8c187aa398df31d1bed33f37a96#diff-c47499725b252b6e8bc56f93f82205e49df4014e2c06c508accf2937e2ab0e5cR39
Seems there's a collection of them: MDL-75716 MDL-75777 MDL-66902