Failed Unit Tests

Failed Unit Tests

by Jez H -
Number of replies: 2
Hello All,

I have just run the unit tests in a recent 1.8 upgrade and have found 13 errors.

I am not sure how worried I should be about these.

I do not want to start messing with the source code (I want it kept standard) and am unsure how to proceed.

Can anyone offer advice on this issue?

Thanks,

Fail: lib/simpletest/testcode.php / code_test / test_dnc /
File /WWW/moodle/course/groups.php contains DONOTCOMMIT. at [/WWW/moodle/lib/simpletest/testcode.php line 46]
Fail: lib/simpletest/testcode.php / code_test / test_dnc /
File /WWW/moodle/question/type/numerical/edit_numerical_form.php contains DONOTCOMMIT. at [/WWW/moodle/lib/simpletest/testcode.php line 46]
Fail: lib/simpletest/testdmllib.php / datalib_test / test_insert_record /
Insert bad data - error should have been printed. This is known not to work on MySQL. at [/WWW/moodle/lib/simpletest/testdmllib.php line 286]
Fail: lib/simpletest/testcourses.php / xhtml_test / testlogin /
Equal expectation fails at character 0 with [Nick's tests & Things: Login to the site] and [Moodle @ UCE] at [/WWW/moodle/lib/simpletest/testcourses.php line 56]
Fail: question/type/numerical/simpletest/testquestiontype.php / question_numerical_qtype_test / test_get_tolerance_interval /
True assertion got False at [/WWW/moodle/question/type/numerical/simpletest/testquestiontype.php line 109]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_get_user /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 33]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_add_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 65]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_add_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 66]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_add_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 67]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_add_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 69]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_add_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 71]
Fail: group/simpletest/test_basicgrouplib.php / basicgrouplib_test / test_remove_member /
True assertion got False at [/WWW/moodle/group/simpletest/test_basicgrouplib.php line 75]

Average of ratings: -
In reply to Jez H

Re: Failed Unit Tests

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
2 and 5 are my fault, and I just fixed them.

3, as the message says, is known to fail on MySQL. I wrote that test and I think it is sound. If you tell the database to do something ridiculous (in this case insert a string into a numerical column), I think you should get an error message back, because you probably have a bug in your code that you should fix. However, MySQL disagrees and just quietly inserts zero.
In reply to Tim Hunt

Re: Failed Unit Tests

by Jez H -
Thanks Tim,

I will get the latest verson of the file and try that.

Have you any idea how serious these errors are?

Regards, Jeremy