Moodle
  1. Moodle
  2. MDL-30266

Some failures on unit tests (testcompletionlib.php)

    Details

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

      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

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          Sam Marshall added a comment -

          Rebased

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

          Integrated, thanks!

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

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

          Show
          Michael de Raadt added a comment - Test result: 0/1 test cases complete: 0 passes, 0 fails and 0 exceptions. Pure profit!
          Hide
          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
          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
          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
          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
          Eloy Lafuente (stronk7) added a comment -

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

          Thanks! Closing...

          Show
          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: