-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.3.6, 3.4.3, 3.5
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
This is a similar in philosophy to -- which was done in Moodle 2.8. There, we randomised the starting value of DB sequences, to ensure that people did not write fragile unit tests because they had hard-coded expected ids in asserts.MDL-43835
There is another problem, where core unit tests assume that, for example, a new Moodle install only has one course category, but a third-party plugin my create a course category for its own use on install.
In order to prevent these test-breaking assumptions from getting in to Moodle core, perhaps we should change the PHPunit site installer, so that after a default Moodle install, it generates a small random number (0, 1 or 2) of some key entities (e.g. user, course, category, question). These things should be given very specific names, to minimise the change they break existing tests.
As a specific example, if you install qtype_coderunner, then core_question_privacy_provider_testcase starts failing.
- has a non-specific relationship to
-
MDL-69016 Unit tests fail if an adhoc task is queued during install
- Open
-
MDL-47726 test_custom_textarea_field fails when a plugin creates a custom user text field during install
- Closed
-
MDL-62781 core_question_privacy_provider_testcase makes assumptions that CodeRunner breaks
- Closed
-
MDL-70321 MDL-47178 unit tests fail if you have CodeRunner installed
- Closed
-
MDL-73004 tool_brickfield unit tests fail if you install qtype_coderunner
- Closed
-
MDL-74427 Coding error detected when deleting question category
- Closed
-
MDL-77611 tool_uploaduser\cli_test.php fails if other installed plugins create custom profile fields on install
- Closed
-
MDL-77659 core_reportbuilder\local\helpers\user_profile_fields_test.php tests fail when other user profile fields exist
- Closed
-
MDL-43835 Use unique sequence values on database reset to pick unit testing mistakes
- Closed
- has been marked as being related by
-
MDL-78233 Failure of unittest test_update_capabilities_install_performance
- Open
-
MDL-62488 Filebrowser unit tests shouldn't assume content of system context
- Closed
-
MDL-68503 event_profile_field_test fails if a plugin has created additional categories
- Closed
-
MDL-75431 Some recently added unit tests fail if CodeRunner is installed
- Closed
-
MDL-79132 core\plugininfo\editor_test and core_admin\external\set_plugin_order_test failures if you install another editor
- Closed
-
MDL-81915 Unit test test_admin_output_new_settings_by_page in adminlib_test is failing
- Closed