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

Random error in test_loadAddons()

XMLWordPrintable

    • Moppies Kanban

      In test_loadAddons() this sentence $this->framework->loadAddons() is used to load the addons libraries and get the info related. The results are not sorted, so in the test when this assert is done ["$this->assertEquals('Library', $addons[0]['machineName']);"|https://github.com/moodle/moodle/blob/master/h5p/tests/framework_test.php#L476] we don't really know if 'Library' will be the first element of the array. So, sometimes we get some error in the PHPUnit test because it's expected one value and it gets another.

      Example of the error: Failed asserting that two strings are equal.

       

      1) core_h5p\framework_testcase::test_loadAddons
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual1
      -'Library'
      +'Library1'
      /moodle/h5p/tests/framework_test.php:
      /moodle/lib/phpunit/classes/advanced_testcase.php:
      To re-run: vendor/bin/phpunit --verbose "core_h5p\framework_testcase" h5p/tests/framework_test.php
      

            pholden Paul Holden
            cescobedo Carlos Escobedo
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 35 minutes
                1h 35m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.