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

core_files_externallib_testcase::test_get_files sporadically fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.6
    • Unit tests
    • 2
    • BACKEND Sprint 4

      This test keeps failing on the integration server because of minor time differences.

      1. Ideally you would change the test so it doesn't depend on us having the two evaluations happen within 1 second of each other because that often leads to failures.
      2. But also, your test data is wrong, its passing because php sucks, but as this diff below shows:
        1. 'itemid' => 1 should be 'itemid' => '1'
        2. 'isdir' => null should be 'isdir' => false

      Output:

      core_files_externallib_testcase::test_get_files
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
                   'filearea' => 'content'
      -            'itemid' => '1'
      +            'itemid' => 1
                   'filepath' => '/'
                   'filename' => 'Simple4.txt'
                   'url' => 'http://www.example.com/moodle...e4.txt'
      -            'isdir' => false
      -            'timemodified' => '1377497719'
      +            'isdir' => null
      +            'timemodified' => '1377497718'
               )
           )
       )
       
      /var/lib/jenkins/git_repositories/master/files/tests/externallib_test.php:285
      /var/lib/jenkins/git_repositories/master/lib/phpunit/classes/advanced_testcase.php:76
      

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1551/testReport/junit/(root)/core_files_externallib_testcase/test_get_files/

            abgreeve Adrian Greeve
            poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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