Moodle
  1. Moodle
  2. MDL-29677

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      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.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      19184

      Description

      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

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Sent to integration.

          Show
          Eloy Lafuente (stronk7) added a comment - Sent to integration.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Sam Hemelryk added a comment -

          Hoorah to have this fixed - what a simple little fix for such an annoying bug! Thanks Eloy.

          Show
          Sam Hemelryk added a comment - Hoorah to have this fixed - what a simple little fix for such an annoying bug! Thanks Eloy.
          Hide
          Ankit Agarwal added a comment -

          Hi,
          Works like a charm.

          Found another unrelated issue. Created MDL-29729 with details.
          Thanks

          Show
          Ankit Agarwal added a comment - Hi, Works like a charm. Found another unrelated issue. Created MDL-29729 with details. Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Many thanks for the hard work developing and testing this. It has been spread to cvs and git upstream repositories.

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work developing and testing this. It has been spread to cvs and git upstream repositories. Closing, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: