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

unit test failures in master branch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0
    • 4.0
    • Libraries
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Re-initialize and execute test, confirm it passes:

      $ php admin/tool/phpunit/cli/init.php
      $ vendor/bin/phpunit course/tests/courselib_test.php --filter test_course_classify_courses_for_timeline
      

      Show
      Re-initialize and execute test, confirm it passes: $ php admin/tool/phpunit/cli/init.php $ vendor/bin/phpunit course/tests/courselib_test.php --filter test_course_classify_courses_for_timeline

      We're seeing these in our CI for Moodle 4.0

      ```
      PHP Warning: Use of undefined constant COURSE_TIMELINE_PAST - assumed 'COURSE_TIMELINE_PAST' (this will throw an Error in a future version of PHP) in /var/www/html/course/tests/courselib_test.php on line 4457
      PHP Warning: Use of undefined constant COURSE_TIMELINE_FUTURE - assumed 'COURSE_TIMELINE_FUTURE' (this will throw an Error in a future version of PHP) in /var/www/html/course/tests/courselib_test.php on line 4458
      PHP Warning: Use of undefined constant COURSE_TIMELINE_INPROGRESS - assumed 'COURSE_TIMELINE_INPROGRESS' (this will throw an Error in a future version of PHP) in /var/www/html/course/tests/courselib_test.php on line 4459
      PHP Warning: Use of undefined constant COURSE_TIMELINE_PAST - assumed 'COURSE_TIMELINE_PAST' (this will throw an Error in a future version of PHP) in /var/www/html/course/tests/courselib_test.php on line 4476
       
      1) core_course\courselib_test::test_course_classify_courses_for_timeline with data set "no courses" (array(), array(array(), array(), array()))
      sort() expects parameter 1 to be array, null given
       
      /var/www/html/course/tests/courselib_test.php:4572
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      phpvfscomposer:///var/www/html/vendor/phpunit/phpunit/phpunit:97
       
      2) core_course\courselib_test::test_course_classify_courses_for_timeline with data set "only past" (array(array('past1', 1645639567, 1645725967), array('past2', 1645639567, 1645725967)), array(array('past1', 'past2'), array(), array()))
      sort() expects parameter 1 to be array, null given
       
      /var/www/html/course/tests/courselib_test.php:4572
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      phpvfscomposer:///var/www/html/vendor/phpunit/phpunit/phpunit:97
       
      3) core_course\courselib_test::test_course_classify_courses_for_timeline with data set "only in progress" (array(array('inprogress1', 1645725967, 1645898767), array('inprogress2', 1645725967, 1645898767)), array(array(), array(), array('inprogress1', 'inprogress2')))
      sort() expects parameter 1 to be array, null given
       
      /var/www/html/course/tests/courselib_test.php:4572
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      phpvfscomposer:///var/www/html/vendor/phpunit/phpunit/phpunit:97
      ```
      I suspect it's reproduceable by doing an init call and then running the test immediately after - probably similar to WP-2774 and MDL-73391 (we run our tests in suites here)

            pholden Paul Holden
            danmarsden Dan Marsden
            Dan Marsden Dan Marsden
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 36 minutes
                36m

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