Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-944 Moodle 2.1 QA Cycle 1
  3. MDLQA-1148

CLONE - An administrator can run unit tests for the site

    Details

    • Type: Functional Test
    • Status: Passed
    • Affects Version/s: Moodle 2.1
    • Fix Version/s: Moodle 2.1
    • Component/s: Administrator
    • Labels:
      None

      Description

      1. Login as admin and browse to Settings > Site administration > Development > Unit tests.
      2. Click the run tests button.
      3. Check that all unit tests pass.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            rezeau Joseph Rézeau added a comment -

            Exception: backup/util/factories/simpletest/testfactory.php / ► backup_factories_test / ► test_backup_factory
            Unexpected exception of type [base_logger_exception] with message [Exception with missing language string

            {file_not_writable}

            from language file

            {error}

            with data

            {/tmp/test.html}

            ] in [\moodle\backup\util\loggers\file_logger.class.php line 40]

            Exception: backup/util/loggers/simpletest/testlogger.php / ► logger_test / ► test_file_logger
            Unexpected PHP error [unlink(C:\server\moodledatagit21dev/temp/test/test_file_logger.html) [<a href='function.unlink'>function.unlink</a>]: Permission denied] severity [E_WARNING] in [\moodle\backup\util\loggers\simpletest\testlogger.php line 289]

            Fail: lib/dml/simpletest/testdml.php / ► dml_test / ► 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. at [moodle\lib\dml\simpletest\testdml.php line 3058]

            Exception: lib/dml/simpletest/testdml.php / ► dml_test / ► test_unique_index_collation_trouble
            Unexpected exception of type [dml_write_exception] with message [Error writing to database] in [\moodle\lib\dml\moodle_database.php line 396]

            Show
            rezeau Joseph Rézeau added a comment - Exception: backup/util/factories/simpletest/testfactory.php / ► backup_factories_test / ► test_backup_factory Unexpected exception of type [base_logger_exception] with message [Exception with missing language string {file_not_writable} from language file {error} with data {/tmp/test.html} ] in [\moodle\backup\util\loggers\file_logger.class.php line 40] Exception: backup/util/loggers/simpletest/testlogger.php / ► logger_test / ► test_file_logger Unexpected PHP error [unlink(C:\server\moodledatagit21dev/temp/test/test_file_logger.html) [<a href='function.unlink'>function.unlink</a>] : Permission denied] severity [E_WARNING] in [\moodle\backup\util\loggers\simpletest\testlogger.php line 289] Fail: lib/dml/simpletest/testdml.php / ► dml_test / ► 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. at [moodle\lib\dml\simpletest\testdml.php line 3058] Exception: lib/dml/simpletest/testdml.php / ► dml_test / ► test_unique_index_collation_trouble Unexpected exception of type [dml_write_exception] with message [Error writing to database] in [\moodle\lib\dml\moodle_database.php line 396]
            Hide
            salvetore Michael de Raadt added a comment -

            Hi, Joseph.

            Did you run this test on your own instance or on qa.moodle.net?

            Michael;

            Show
            salvetore Michael de Raadt added a comment - Hi, Joseph. Did you run this test on your own instance or on qa.moodle.net? Michael;
            Hide
            rezeau Joseph Rézeau added a comment -

            @Michael
            I run all tests on my own (local) moodle test site.

            Show
            rezeau Joseph Rézeau added a comment - @Michael I run all tests on my own (local) moodle test site.
            Hide
            tsala Helen Foster added a comment -

            I've just tried this on the QA testing site and obtained the following results:

            156/203 test cases complete: 5647 passes, 11 fails and 1 exceptions (reported as MDL-27983).

            Just wondering why MDLQA-1017 is linked to this issue?

            Show
            tsala Helen Foster added a comment - I've just tried this on the QA testing site and obtained the following results: 156/203 test cases complete: 5647 passes, 11 fails and 1 exceptions (reported as MDL-27983 ). Just wondering why MDLQA-1017 is linked to this issue?
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            Ho results here, all passing are:

            195/204 test cases complete: 6492 passes, 0 fails and 0 exceptions.

            Also some explanations:

            • Joshep, the 2 you are getting about DB are "normal" if not using one case-sensitive collation in your MySQL DB. The only case-sensitive collation available publicly is utf8_bin. I would ignore those two.
            • Joshep, the 2 you are getting about backup seem related to sort of permissions problem trying to write to "/tmp/test.html". Surely that fails in Windows where that dir is not available and also in other hosts where that dir is not accesible? I'll rewrite those tests to use $CFG->dataroot/temp instead (have created MDL-28122 for that).
            • Helen: the 11 you got (MDL-27983) were mainly caused by the DB not being InnoDB, so all the tests about transactions are failing there, the collation ones are dupe of Joshep's ones above and also you're missing the php_intl extension (optional) but causing some test to fail. So no problem with them either, thanks!
            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited Ho results here, all passing are: 195/204 test cases complete: 6492 passes, 0 fails and 0 exceptions. Also some explanations: Joshep, the 2 you are getting about DB are "normal" if not using one case-sensitive collation in your MySQL DB. The only case-sensitive collation available publicly is utf8_bin. I would ignore those two. Joshep, the 2 you are getting about backup seem related to sort of permissions problem trying to write to "/tmp/test.html". Surely that fails in Windows where that dir is not available and also in other hosts where that dir is not accesible? I'll rewrite those tests to use $CFG->dataroot/temp instead (have created MDL-28122 for that). Helen: the 11 you got ( MDL-27983 ) were mainly caused by the DB not being InnoDB, so all the tests about transactions are failing there, the collation ones are dupe of Joshep's ones above and also you're missing the php_intl extension (optional) but causing some test to fail. So no problem with them either, thanks!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            I'm just trying to enable portfolios and web services here to get their corresponding unit tests also executed and complete this. Back soon.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - I'm just trying to enable portfolios and web services here to get their corresponding unit tests also executed and complete this. Back soon.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            Oki, once I enabled webservices I've found these:

            1) Webservice tests are really outdated (missing tons of services) and require manual hacking to make them work. I recommend creating one issue about to 100% refactor them, using custom DB tables, covering all webservices automatically... not requiring any manual setup...

            2) I run them with these results:

            1/1 test cases complete: 381 passes, 0 fails and 1 exceptions.
             
            Exception: webservice/simpletest/testwebservice.php / ▶ webservice_test / ▶ testRun
            Unexpected exception of type [Zend_XmlRpc_Client_FaultException] with message [Invalid external api parameter: timezone (Invalid external api parameter)] in [/Users/stronk7/git_moodle/integration/lib/zend/Zend/XmlRpc/Client.php line 370]
            line 59 of /webservice/xmlrpc/lib.php: call to Zend_XmlRpc_Client->call()
            line 916 of /webservice/simpletest/testwebservice.php: call to webservice_xmlrpc_client->call()
            line 162 of /webservice/simpletest/testwebservice.php: call to webservice_test->moodle_user_update_users()

            I recommend creating another issue for this too, although perhaps it's the test itself the one being outdated. It sounds to me that we added that properly (timezone) recently.

            No matter of 1) and 2) I'd suggest to pass this as all the "normal" unit tests seem to be passing ok. There is some minor problem as stated in previous comments, but no one seems to be a true stopper IMO.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited Oki, once I enabled webservices I've found these: 1) Webservice tests are really outdated (missing tons of services) and require manual hacking to make them work. I recommend creating one issue about to 100% refactor them, using custom DB tables, covering all webservices automatically... not requiring any manual setup... 2) I run them with these results: 1/1 test cases complete: 381 passes, 0 fails and 1 exceptions.   Exception: webservice/simpletest/testwebservice.php / ▶ webservice_test / ▶ testRun Unexpected exception of type [Zend_XmlRpc_Client_FaultException] with message [Invalid external api parameter: timezone (Invalid external api parameter)] in [/Users/stronk7/git_moodle/integration/lib/zend/Zend/XmlRpc/Client.php line 370] line 59 of /webservice/xmlrpc/lib.php: call to Zend_XmlRpc_Client->call() line 916 of /webservice/simpletest/testwebservice.php: call to webservice_xmlrpc_client->call() line 162 of /webservice/simpletest/testwebservice.php: call to webservice_test->moodle_user_update_users() I recommend creating another issue for this too, although perhaps it's the test itself the one being outdated. It sounds to me that we added that properly (timezone) recently. No matter of 1) and 2) I'd suggest to pass this as all the "normal" unit tests seem to be passing ok. There is some minor problem as stated in previous comments, but no one seems to be a true stopper IMO. Ciao
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Also found this MDL-28126 for immediately after 2.1.0

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Also found this MDL-28126 for immediately after 2.1.0
            Hide
            aborrow Anthony Borrow added a comment -

            I've run this on a local install with mysql set to innodb and using utf_bin collation for case sensitivity on a relatively new database with one course created and one activity in it with some imported users. The first time I ran the unit tests without the course activity, it skipped tests related to course modules and said that it needed one in order to test. It passed all 189/204 tests that it ran. The second time I ran the test I believe there is a bug creating tst_capabilities table. I'll file an MDL issue for that and continue testing. Peace - Anthony

            Show
            aborrow Anthony Borrow added a comment - I've run this on a local install with mysql set to innodb and using utf_bin collation for case sensitivity on a relatively new database with one course created and one activity in it with some imported users. The first time I ran the unit tests without the course activity, it skipped tests related to course modules and said that it needed one in order to test. It passed all 189/204 tests that it ran. The second time I ran the test I believe there is a bug creating tst_capabilities table. I'll file an MDL issue for that and continue testing. Peace - Anthony
            Hide
            aborrow Anthony Borrow added a comment -

            I am able to get the unit tests to all run and pass (with the exception of the webservices) stuff which I did not test. I am going to go ahead and pass this. Peace - Anthony

            Show
            aborrow Anthony Borrow added a comment - I am able to get the unit tests to all run and pass (with the exception of the webservices) stuff which I did not test. I am going to go ahead and pass this. Peace - Anthony
            Hide
            aborrow Anthony Borrow added a comment -

            Besides the output listed at the bottom of the page for which I have filed MDL-28140, everything passes fine (except for web services which I did not have setup to test). Peace - Anthony

            Show
            aborrow Anthony Borrow added a comment - Besides the output listed at the bottom of the page for which I have filed MDL-28140 , everything passes fine (except for web services which I did not have setup to test). Peace - Anthony

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: