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

Some failures on unit tests (testcompletionlib.php)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: Activity completion
    • Labels:

      Description

      Running all unit tests, I got this ones related to completionlib:

      Fail: lib/simpletest/testcompletionlib.php / ▶ completionlib_test / ▶ test_get_progress_all
      Mock method [get_tracked_users] at [0] -> Expected 6 arguments of [Boolean: false, Array: 0 items, Integer: 0, String: , String: , String: ] but got 7 arguments of [Boolean: false, Array: 0 items, Integer: 0, String: , String: , String: , NULL] at [/Users/stronk7/git_moodle/integration/lib/simpletest/testcompletionlib.php line 530]
      line ... of ...
      line 1210 of /lib/completionlib.php: call to completion_cutdown->get_tracked_users()
      line 556 of /lib/simpletest/testcompletionlib.php: call to completion_info->get_progress_all()
      line ... of ...

      and

      Fail: lib/simpletest/testcompletionlib.php / ▶ completionlib_test / ▶ test_get_progress_all
      Mock method [get_tracked_users] at [1] -> Expected 6 arguments of [Boolean: true, Integer: 3, Integer: 0, String: , String: , String: ] but got 7 arguments of [Boolean: true, Integer: 3, Integer: 0, String: , String: , String: , NULL] at [/Users/stronk7/git_moodle/integration/lib/simpletest/testcompletionlib.php line 559]
      line ... of ...
      line 1210 of /lib/completionlib.php: call to completion_cutdown->get_tracked_users()
      line 594 of /lib/simpletest/testcompletionlib.php: call to completion_info->get_progress_all()
      line ... of ...

      Tracing the problem down, it seems to be cause by MDL-26647

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            quen Sam Marshall added a comment -

            Oops - sorry. I didn't think it would cause any breakage to add a new parameter to the get_tracked_users function, with default null. But this breaks the mock expectations in the unit test. I just added null to the expectations and it works now.

            Show
            quen Sam Marshall added a comment - Oops - sorry. I didn't think it would cause any breakage to add a new parameter to the get_tracked_users function, with default null. But this breaks the mock expectations in the unit test. I just added null to the expectations and it works now.
            Hide
            stronk7 Eloy Lafuente (stronk7) 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

            PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.

            Show
            stronk7 Eloy Lafuente (stronk7) 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 PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.
            Hide
            quen Sam Marshall added a comment -

            Rebased

            Show
            quen Sam Marshall added a comment - Rebased
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
            Hide
            salvetore Michael de Raadt added a comment -

            Test result: 0/1 test cases complete: 0 passes, 0 fails and 0 exceptions. Pure profit!

            Show
            salvetore Michael de Raadt added a comment - Test result: 0/1 test cases complete: 0 passes, 0 fails and 0 exceptions. Pure profit!
            Hide
            salvetore Michael de Raadt added a comment -

            Oops, hang on. That says no tests were run. It's good that it's green but...

            Having another look.

            Show
            salvetore Michael de Raadt added a comment - Oops, hang on. That says no tests were run. It's good that it's green but... Having another look.
            Hide
            salvetore Michael de Raadt added a comment -

            No worries, I didn't have the $CFG->unittestprefix variable set.

            Real test result: 1/1 test cases complete: 106 passes, 0 fails and 0 exceptions.

            \o/

            Show
            salvetore Michael de Raadt added a comment - No worries, I didn't have the $CFG->unittestprefix variable set. Real test result: 1/1 test cases complete: 106 passes, 0 fails and 0 exceptions. \o/
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            U P S T R E A M I Z E D !

            Thanks! Closing...

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Thanks! Closing...

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/11