Moodle
  1. Moodle
  2. MDL-37547

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

    Details

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

      Description

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

        Issue Links

          Activity

          Hide
          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 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
          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
          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
          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
          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
          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
          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
          Aparup Banerjee added a comment -

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

          Show
          Aparup Banerjee added a comment - tested and passing this. its already done its job in picking out bugs!
          Hide
          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
          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
          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
          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
          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
          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 Wiese added a comment -

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

          Show
          Damyon Wiese added a comment - These tests are failing on oracle due to a precision/rounding error.
          Hide
          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
          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 Wiese added a comment -

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

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

          pulled that fix in

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

          Thanks!

          Show
          Damyon Wiese added a comment - Thanks!
          Hide
          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
          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: