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

Silent problem in moodle_page_test caused other tests to produce wrong debug information

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.6, 2.1.3
    • 2.0.4, 2.1.1, 2.2
    • Unit tests
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • Moderate
    • Hide

      admin -> Development -> Unit tests

      Run the following tests under 20_STABLE, 21_STABLE and master:

      • /lib/simpletest/testpagelib_moodlepage.php
      • /question
      • ALL (box empty)

      TEST: None of them outputs any debugging information like the posted in the description of this issue (box/containers related). You can safely ignore any other exception / failure in the execution. This is only about fix that incorrect debugging.

      Show
      admin -> Development -> Unit tests Run the following tests under 20_STABLE, 21_STABLE and master: /lib/simpletest/testpagelib_moodlepage.php /question ALL (box empty) TEST: None of them outputs any debugging information like the posted in the description of this issue (box/containers related). You can safely ignore any other exception / failure in the execution. This is only about fix that incorrect debugging.

      Since some time ago, each time ALL unittests are executed, their execution ends ok but a lot of debugging information is send out about incorrectly nested boxes / containers.

      For the records, here it's an excerpt (it's really much, much bigger):

      Some HTML tags were opened in the body of the page but not closed.
       
      Open box at:
      line 1237 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2226 of /lib/outputrenderers.php: call to xhtml_container_stack->push()
      line 127 of /admin/tool/unittest/index.php: call to core_renderer->box_start()
      Close box at:
      line 1264 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2236 of /lib/outputrenderers.php: call to xhtml_container_stack->pop()
      line 145 of /admin/tool/unittest/index.php: call to core_renderer->box_end()
      Open box at:
      line 1237 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2226 of /lib/outputrenderers.php: call to xhtml_container_stack->push()
      line 156 of /admin/tool/unittest/index.php: call to core_renderer->box_start()
      Close box at:
      line 1264 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2236 of /lib/outputrenderers.php: call to xhtml_container_stack->pop()
      line 163 of /admin/tool/unittest/index.php: call to core_renderer->box_end()
      ...
      ...
      ...

      After tracing the execution a lot, it was detected that the culprit of the problem was the moodle_page_test unit test (within lib/simpletest/testpagelib_moodlepage.php), because due to one missing global $PAGE it was unable to restitute the original status of the page, so other tests later (/question ones, also playing with page/output...) were running under an incorrect status.

      So this is simply fixed by adding the missing global to moodle_page_test->tearDown(). Doing.

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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