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

Handle CFG->phpunit_dataroot like CFG->dataroot is

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Unit tests
    • Labels:
      None
    • Testing Instructions:
      Hide

      0. Setup your site so you make $CFG->phpunit_dataroot to point to one link to a real directory (unix/mac required?)

      a. Running:

      phpunit moodlelib_testcase lib/tests/moodlelib_test.php

      should be enough as far as it includes 1 assertion checking for this.

      b. Running all tests will confirm nothing else breaks with the changes.

      1. Repeat a & b with $CFG->phpunit_dataroot pointing to a real directory.

      That is, ciao

      Show
      0. Setup your site so you make $CFG->phpunit_dataroot to point to one link to a real directory (unix/mac required?) a. Running: phpunit moodlelib_testcase lib/tests/moodlelib_test.php should be enough as far as it includes 1 assertion checking for this. b. Running all tests will confirm nothing else breaks with the changes. 1. Repeat a & b with $CFG->phpunit_dataroot pointing to a real directory. That is, ciao
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When running unittests it should be always true that:

      CFG->phpunit_dataroot === CFG->dataroot

      but this has been detected to fail sometimes (see MDL-34344 failing tests).

      The ultimate reason seems to be that we always realpath(CFG->dataroot) but don't do the same with CFG->phpunit_dataroot.

      So this is a proposal to, simply, apply the realpath() to CFG->phpunit_dataroot to ensure that the equality above always works.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              skodak Petr Skoda added a comment -

              +1

              Show
              skodak Petr Skoda added a comment - +1
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              (thanks!)

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - (thanks!)
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Integrated (23, 24 & master), thanks!

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Passing, all unit tests completed without problem, both locally and the 2 CI ones.

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Passing, all unit tests completed without problem, both locally and the 2 CI ones.
              Hide
              poltawski Dan Poltawski added a comment -

              Hurray! We did it! Thanks to all the reporters, testers, user and watchers for a bumper week of Moodling!

              Show
              poltawski Dan Poltawski added a comment - Hurray! We did it! Thanks to all the reporters, testers, user and watchers for a bumper week of Moodling!
              Hide
              skodak Petr Skoda added a comment -

              oh, this created a regression - the test dataroot is not created any more because the realpath() returns false for non-existent dirs.

              Either we should move the mkdir() or remove it completely...

              Show
              skodak Petr Skoda added a comment - oh, this created a regression - the test dataroot is not created any more because the realpath() returns false for non-existent dirs. Either we should move the mkdir() or remove it completely...

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Mar/13