Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-37547

Add Unit tests for functions for mod/assign/lib.php

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Assignment
    • Labels:

      Description

      Currently there are unit tests for locallib and externallib but not lib.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            damyon Damyon Wiese added a comment -

            The error in the linked issue would have been caught with these extra unit tests. The main purpose of the tests is to make sure the code is run and does not throw errors.

            Show
            damyon Damyon Wiese added a comment - The error in the linked issue would have been caught with these extra unit tests. The main purpose of the tests is to make sure the code is run and does not throw errors.
            Hide
            poltawski Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            poltawski Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            nebgor Aparup Banerjee added a comment -

            There was 1 error:

            1) mod_assign_lib_testcase::test_assign_print_overview
            dml_exception: ERROR: Incorrect number of query parameters. Expected 3, got 2.

            /Users/aparup/Sites/i/lib/dml/moodle_database.php:802
            /Users/aparup/Sites/i/lib/dml/mysqli_native_moodle_database.php:1000
            /Users/aparup/Sites/i/mod/assign/lib.php:376
            /Users/aparup/Sites/i/mod/assign/tests/lib_test.php:134
            /Users/aparup/Sites/i/lib/phpunit/classes/advanced_testcase.php:76

            Show
            nebgor Aparup Banerjee added a comment - There was 1 error: 1) mod_assign_lib_testcase::test_assign_print_overview dml_exception: ERROR: Incorrect number of query parameters. Expected 3, got 2. /Users/aparup/Sites/i/lib/dml/moodle_database.php:802 /Users/aparup/Sites/i/lib/dml/mysqli_native_moodle_database.php:1000 /Users/aparup/Sites/i/mod/assign/lib.php:376 /Users/aparup/Sites/i/mod/assign/tests/lib_test.php:134 /Users/aparup/Sites/i/lib/phpunit/classes/advanced_testcase.php:76
            Hide
            nebgor Aparup Banerjee added a comment -

            MDL-37619 was created to handle the transitional issue discovered by an issue just recently integrated. see MDL-37619

            this has been integrated into master now.

            Show
            nebgor Aparup Banerjee added a comment - MDL-37619 was created to handle the transitional issue discovered by an issue just recently integrated. see MDL-37619 this has been integrated into master now.
            Hide
            nebgor Aparup Banerjee added a comment -

            tested and passing this. its already done its job in picking out bugs!

            Show
            nebgor Aparup Banerjee added a comment - tested and passing this. its already done its job in picking out bugs!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Our beloved integration servers are throwing this since some iterations ago:

            mod_assign_lib_testcase::test_assign_print_overview
            dml_exception: ERROR: Incorrect number of query parameters. Expected 3, got 2.
             
            /var/lib/jenkins/git_repositories/master/mod/assign/tests/lib_test.php:134

            Ciao

            PS: Failing test, just in case...

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Our beloved integration servers are throwing this since some iterations ago: mod_assign_lib_testcase::test_assign_print_overview dml_exception: ERROR: Incorrect number of query parameters. Expected 3, got 2.   /var/lib/jenkins/git_repositories/master/mod/assign/tests/lib_test.php:134 Ciao PS: Failing test, just in case...
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            (hoh, sorry Apu, somehow I had this page open in my browser and didn't see your latest comments!)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - (hoh, sorry Apu, somehow I had this page open in my browser and didn't see your latest comments!)
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Passing in behalf of Apu, now that MDL-37619 has been integrated and CI servers are not crying anymore.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Passing in behalf of Apu, now that MDL-37619 has been integrated and CI servers are not crying anymore.
            Hide
            damyon Damyon Wiese added a comment -

            These tests are failing on oracle due to a precision/rounding error.

            Show
            damyon Damyon Wiese added a comment - These tests are failing on oracle due to a precision/rounding error.
            Hide
            poltawski Dan Poltawski added a comment -

            Sending back to failed for some failures on oracle:

            3) mod_assign_lib_testcase::test_assign_user_outline
            Failed asserting that 'Grade: 50' matches PCRE pattern "/50.0/".

            /server/workspace/moodle/mod/assign/tests/lib_test.php:200
            /server/workspace/moodle/lib/phpunit/classes/advanced_testcase.php:76

            To re-run:
            /usr/bin/phpunit mod_assign_lib_testcase mod/assign/tests/lib_test.php

            Show
            poltawski Dan Poltawski added a comment - Sending back to failed for some failures on oracle: 3) mod_assign_lib_testcase::test_assign_user_outline Failed asserting that 'Grade: 50' matches PCRE pattern "/50.0/". /server/workspace/moodle/mod/assign/tests/lib_test.php:200 /server/workspace/moodle/lib/phpunit/classes/advanced_testcase.php:76 To re-run: /usr/bin/phpunit mod_assign_lib_testcase mod/assign/tests/lib_test.php
            Hide
            damyon Damyon Wiese added a comment -

            Pushed an extra commit to fix the failed test on Oracle.

            Show
            damyon Damyon Wiese added a comment - Pushed an extra commit to fix the failed test on Oracle.
            Hide
            poltawski Dan Poltawski added a comment -

            pulled that fix in

            Show
            poltawski Dan Poltawski added a comment - pulled that fix in
            Hide
            damyon Damyon Wiese added a comment -

            Thanks!

            Show
            damyon Damyon Wiese added a comment - Thanks!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Surely you will be happy to know that your code is now part of Moodle upstream. Thanks, thanks!

            Closing as fixed, ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Surely you will be happy to know that your code is now part of Moodle upstream. Thanks, thanks! Closing as fixed, ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13