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

Unit test failure in master branch undefined function external_generate_token_for_current_user

XMLWordPrintable

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

      Initialise phpunit:

      php admin/tool/phpunit/cli/init.php

      immediately after, run core_notifications_testcase tests and make sure no errors are reported.

      $ vendor/bin/phpunit --testsuite=core_login_testsuite --filter core_login_notifications_testcase

       

      Show
      Initialise phpunit: php admin/tool/phpunit/cli/init.php immediately after, run core_notifications_testcase tests and make sure no errors are reported. $ vendor/bin/phpunit --testsuite=core_login_testsuite --filter core_login_notifications_testcase  

      We're seeing these in our CI for Moodle 4.0

      1) core_login_notifications_testcase::test_mobile_app_login_notificationError: Call to undefined function external_generate_token_for_current_user()
      /var/www/html/login/tests/notifications_test.php:158/var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      2) core_login_notifications_testcase::test_mobile_app_login_notification_skip_same_ipError: Call to undefined function external_generate_token_for_current_user()
      /var/www/html/login/tests/notifications_test.php:207/var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      3) core_login_notifications_testcase::test_mobile_app_login_notification_skip_same_deviceError: Call to undefined function external_generate_token_for_current_user()
      /var/www/html/login/tests/notifications_test.php:254/var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      ERRORS!

      I suspect it's reproduceable by doing an init call and then running the test immediately after - probably similar to WP-2774 (we run our tests in suites here)

            danmarsden Dan Marsden
            danmarsden Dan Marsden
            Paul Holden Paul Holden
            Victor Déniz Falcón Victor Déniz Falcón
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 45 minutes
                45m

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