Moodle

Unit tests needs help link and warning that it can impact database

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.9.7
  • Fix Version/s: None
  • Component/s: Unit tests
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

Hi,
I noticed that the recommendation for [[Unit tests]] is "not " to run this "report" on a production site because it takes a long time and could damage the database. The "damage" is red flag for me.

If this is true, it should be a high priority to place a warning on the " Run the unit tests " filter page, AND create a help link.

Perhaps this feature should also have a server setting, with the default set to "off", so it does not appear in the report menu for the non-developer site administrators.

Best Chris

.

Activity

Hide
Chris Collman added a comment -

Just a followup. demo.moodle.net site administration block>reports>Unit tests screen does not give any cautions. The help link goes to admin/report/unittest/index which is a page that needs to be created, so there is no help there.

I am still concerned that some new Admin may run the report and not realize what is going to happen. What if they add contributed code and things go wrong when they innocently check the "wrong box". I think this should turned off as a default in a site setting, so that someone interested in development has to knowingly turn it on and thus assume responsibility for it being visible in Reports.

Show
Chris Collman added a comment - Just a followup. demo.moodle.net site administration block>reports>Unit tests screen does not give any cautions. The help link goes to admin/report/unittest/index which is a page that needs to be created, so there is no help there. I am still concerned that some new Admin may run the report and not realize what is going to happen. What if they add contributed code and things go wrong when they innocently check the "wrong box". I think this should turned off as a default in a site setting, so that someone interested in development has to knowingly turn it on and thus assume responsibility for it being visible in Reports.
Hide
Helen Foster added a comment -

Chris, thanks for your report. I agree with you that the unit tests page in Moodle needs some explanatory text and maybe a help pop-up too.

I've redirected the 'Moodle Docs for this page' link to http://docs.moodle.org/en/Development:Unit_tests

(It seems the link was changed for some reason, as it was previously http://docs.moodle.org/en/admin/report/simpletest/index )

Show
Helen Foster added a comment - Chris, thanks for your report. I agree with you that the unit tests page in Moodle needs some explanatory text and maybe a help pop-up too. I've redirected the 'Moodle Docs for this page' link to http://docs.moodle.org/en/Development:Unit_tests (It seems the link was changed for some reason, as it was previously http://docs.moodle.org/en/admin/report/simpletest/index )
Hide
Helen Foster added a comment -

I suggest we add the following text to the the unit tests page (from http://docs.moodle.org/en/Unit_tests thanks to Tim and Chris):

The Unit Test report is a tool for developers to let them automatically test various parts of the Moodle code.

You are advised NOT to run unit tests on a production site (unless you are sure you know what you are doing) for two reasons:

1. The tests involve a lot of processing, and so will slow down your Moodle site for all your other users for a while.
2. Some of the tests involve adding and deleting data from the database. This should be done in a reversible way, but if there is a bug in the test code, it might damage the real date in the database.

On the other hand, if you are doing development, running the tests on your development server is strongly encouraged, as is writing new tests.

Show
Helen Foster added a comment - I suggest we add the following text to the the unit tests page (from http://docs.moodle.org/en/Unit_tests thanks to Tim and Chris): The Unit Test report is a tool for developers to let them automatically test various parts of the Moodle code. You are advised NOT to run unit tests on a production site (unless you are sure you know what you are doing) for two reasons: 1. The tests involve a lot of processing, and so will slow down your Moodle site for all your other users for a while. 2. Some of the tests involve adding and deleting data from the database. This should be done in a reversible way, but if there is a bug in the test code, it might damage the real date in the database. On the other hand, if you are doing development, running the tests on your development server is strongly encouraged, as is writing new tests.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: