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

Strange check for the number of enabled airnotifier providers causes unittests failures when some plugins are installed

    XMLWordPrintable

Details

    • MOODLE_311_STABLE

    Description

      We experience unittests failures in Moodle Workplace in 3.11

      They are caused by this airnotifier configuration check added in MDL-65983:
      https://github.com/moodle/moodle/commit/47a142704da4d3b77eac7e4da1cbd0ec5f9c5c55#diff-ca191b5bb059bb22237d30803e649f2b903075795b55933a92025c99bfaf0254R338-R348

      The thing is - we have a lot of message providers in the workplace plugins and a lot of them are enabled for airnotifier by default. It brings the ratio of enabled vs defined providers to over 25%. This check returns "ok" for workplace.

      However there are three unittests that specifically test that this check returns "warning" (as it does in vanilla Moodle LMS without any plugins).

      This seems like a very strange check and even stranger unittests.

      Here are our failures:

       
      1) message_airnotifier_manager_testcase::test_check_configuration_default
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual
      @@ @@
      -'warning'
      +'ok'
       
      /home/marina/repositories/workplace/moodle/message/output/airnotifier/tests/manager_test.php:45
      /home/marina/repositories/workplace/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      2) message_airnotifier_manager_testcase::test_check_configuration_with_token
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual
      @@ @@
      -'warning'
      +'ok'
       
      /home/marina/repositories/workplace/moodle/message/output/airnotifier/tests/manager_test.php:68
      /home/marina/repositories/workplace/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      3) message_airnotifier_manager_testcase::test_check_configuration_incorrect_settings
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual
      @@ @@
      -'warning'
      +'ok'
       
      /home/marina/repositories/workplace/moodle/message/output/airnotifier/tests/manager_test.php:93
      /home/marina/repositories/workplace/moodle/lib/phpunit/classes/advanced_testcase.php:80
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marina Marina Glancy
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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