Common unit test problems: Difference between revisions
Mark Nelson (talk | contribs) |
Mark Nelson (talk | contribs) |
||
Line 50: | Line 50: | ||
Failed asserting that false is an instance of class "stored_file". | Failed asserting that false is an instance of class "stored_file". | ||
==== Solution ==== | ==== Solution ==== | ||
Go to | Related to installing GD after you initialised PHP Unit. | ||
Go to your Moodle directory and type 'php admin/tool/phpunit/cli/util.php --drop', then reinitialise PHPunit and run the test again. |
Revision as of 04:19, 8 November 2012
Unit tests are taking more than 5 mins to run
This problem is under investigation. We are hoping to find the soluton. On a typical system all tests complete in under 3 mins.--Dan Poltawski 12:43, 15 May 2012 (WST)
You maybe find much better performance on psql as a workaround for now if not doing DB dependent tests.
dml_testcase::test_unique_index_collation_trouble
"Unique index is accent insensitive, this may cause problems for non-ascii languages. This is usually caused by accent insensitive default collation."
Solution
Your Database is incorrectly configured. You probably are running MySQL and need to switch to utf8_unicode_ci collation.
dml_testcase::test_sql_binary_equal
"SQL operator "=" is expected to be case sensitive Failed asserting that 1 matches expected 2."
Solution
Your Database is incorrectly configured. You probably are running MySQL and need to switch to utf8_unicode_ci collation.
moodlesimplepie_testcase::test_getfeed
"Failed to load the sample RSS file. Please check your proxy settings in Moodle. %s"
Solution
Your moodle needs network connectivity, please check proxy settings.
moodlesimplepie_testcase::test_redirect
Failed asserting that 'cURL Error: Operation timed out after 2000 milliseconds with 0 bytes received' is null.
Solution
Your moodle needs network connectivity, please check proxy settings
collatorlib_testcase::test_asort_objects_by_method
Collation aware sorting not supported, PHP extension "intl" is not available.
Solution
Install php intl extension.
Note that, on Windows, this extension does not seem to be included in the installer, but you can get it by downloading the zip, and copying the right DLLs across. If you Google, there are more detailed instructions on Stack Exchange.
grading_manager_testcase::test_tokenize
A test using UTF-8 characters has failed. Consider updating PHP and PHP's PCRE or INTL extensions (MDL-30494) Failed asserting that false is true.
Solution
Your Database is incorrectly configured. You probably are running MySQL and need to switch to utf8_bin collation.
moodlelib_testcase::test_fix_utf8
Failed asserting that false is identical to 'aaabbb'.
Solution
This problem indicates buggy iconv. See [1] for discussion. So this is a real problem, to be fixed in a future integration cycle
Segfaults on Oracle
When I was running tests on oracle I was getting phpunit sefaulting.. --Dan Poltawski 00:29, 16 May 2012 (WST)
Solution
Set statement_cache_size in php.ini: oci8.statement_cache_size = 0
filestoragelib_testcase::test_get_file_preview
Failed asserting that false is an instance of class "stored_file".
Solution
Related to installing GD after you initialised PHP Unit.
Go to your Moodle directory and type 'php admin/tool/phpunit/cli/util.php --drop', then reinitialise PHPunit and run the test again.