Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Unit tests
    • Labels:

      Description

      Includes:

      • constants refactoring
      • new half-finished geenrator
      • reworked db table init
      • support for $CFG->debug = -1
      • functional DB tests
      • fixed $DB->get_indexes() to not throw exceptions when table does not exist
      • fix handling of user passwords in test db
      • add debug info to exception messages
      • removed unnecessary PHP debug errors from mathslib
      • fixed @error suppression in get_string
      • fixed PHPUnit error handler setup
      • added timezone info to default install

      ====================

      remaining tests:

      • grade tests seem to be kind of broken from MDL-24330, it might be best to revert it completely (do not ask me why it passes at present, I tried conversion and failed pretty badly)
      • completionlib - using mocks heavily
      • /question/* (Tim?)
      • webservices - seems to do nothing
      • /mod/data/simpletest/* needs to be rewritten to use data generator instead of stored CSV records that include links ids

      TODO:

      • discuss problem in navigationlib_test.php method test_find_expandable()

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Petr Skoda added a comment -

            to integrators: please integrate after MDL-32251

            Show
            Petr Skoda added a comment - to integrators: please integrate after MDL-32251
            Hide
            Petr Skoda added a comment -

            I have added one more commit fixing the globals reset and improved $USER handling

            Show
            Petr Skoda added a comment - I have added one more commit fixing the globals reset and improved $USER handling
            Hide
            Petr Skoda added a comment -

            I have converted all backup tests and improved performance too.

            Show
            Petr Skoda added a comment - I have converted all backup tests and improved performance too.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Note to avoid forgetting it. Today MDL-17327 has been integrated and it has added a bunch of simpletest tests. Those will need to migrate those too.

            We'll need to delete already migrated tests ASAP, ensuring we are not forgetting anything like those new ones in mod/data.

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Note to avoid forgetting it. Today MDL-17327 has been integrated and it has added a bunch of simpletest tests. Those will need to migrate those too. We'll need to delete already migrated tests ASAP, ensuring we are not forgetting anything like those new ones in mod/data. Ciao
            Hide
            Petr Skoda added a comment -

            rebased on top of current integration master

            Show
            Petr Skoda added a comment - rebased on top of current integration master
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Found 2 portfolio leftovers preventing simpletest to complete:

            • boxnet/simpletest/testportfoliopluginboxnet.php
            • download/simpletest/testportfolioplugindownload.php

            Added commit on top deleting them.

            Show
            Eloy Lafuente (stronk7) added a comment - Found 2 portfolio leftovers preventing simpletest to complete: boxnet/simpletest/testportfoliopluginboxnet.php download/simpletest/testportfolioplugindownload.php Added commit on top deleting them.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Added another commit about some expectError() uses in lib/simpletest/testmathslib.php leading to failures. It seems it was borked in previous simpletest version and not it was working but leading to failures.

            I've executed the tests both with E_ALL | E_STRICT, E_NOTICE and 0 and the tests passed always. So, cleaning those 3 expectError()

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Added another commit about some expectError() uses in lib/simpletest/testmathslib.php leading to failures. It seems it was borked in previous simpletest version and not it was working but leading to failures. I've executed the tests both with E_ALL | E_STRICT, E_NOTICE and 0 and the tests passed always. So, cleaning those 3 expectError() Ciao
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Simpletest: 196/203 test cases complete: 7737 passes, 0 fails and 0 exceptions.
            PHPUnit: OK (579 tests, 17162 assertions).

            Show
            Eloy Lafuente (stronk7) added a comment - Simpletest: 196/203 test cases complete: 7737 passes, 0 fails and 0 exceptions. PHPUnit: OK (579 tests, 17162 assertions).
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Adding Tim, so he can start swimming in the amazing world of Moodle supporting phpunit and lots of cases already available.

            Show
            Eloy Lafuente (stronk7) added a comment - Adding Tim, so he can start swimming in the amazing world of Moodle supporting phpunit and lots of cases already available.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            Show
            Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
            Hide
            Eloy Lafuente (stronk7) added a comment -

            And passing, as far as both simpletest and phpunit are completing without problems.

            Show
            Eloy Lafuente (stronk7) added a comment - And passing, as far as both simpletest and phpunit are completing without problems.
            Hide
            Aparup Banerjee added a comment -

            The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

            Closing, have a good weekend!

            Show
            Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: