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

Testing sites are cleaning all test dataroot contents

    Details

    • Testing Instructions:
      Hide

      Setup behat (init)
      a) Do not run any test. Check that in the behat dataroot you see a file called originaldatafiles.json. Check that filedir contains multiple folder (not just da folder)
      b) run a test. At the end of the test, check that dataroot_behat and dataroot_behat/filedir contain the same folders/files as in a).
      c) drop the behat database with util.php --drop. Check that originaldatafiles.json and filedir has been deleted.
      d) rerun init. Check that dataroot_behat and dataroot_behat/filedir contain the same folders/files as in a).

      Setup phpunit(init)
      a) Do not run any test. Check that in the phpunitdataroot you see a file called originaldatafiles.json. Check that filedir contains multiple folder (not just da folder)
      b) run a test. At the end of the test, check that dataroot_phpunit and dataroot_phpunit/filedir contain the same folders/files as in a).
      c) drop the phpunitdatabase with util.php --drop. Check that originaldatafiles.json and filedir has been deleted.
      d) rerun init. Check that dataroot_phpunit and dataroot_phpunit/filedir contain the same folders/files as in a).

      Last test
      a) clone a new site but don't install it.
      b) delete the mod/assign/feedback/editpdf plugin
      c) install the site
      d) run a behat test. It should not crash.

      Finally, run vendor/bin/phpunit core_test_util_testcase

      Show
      Setup behat (init) a) Do not run any test. Check that in the behat dataroot you see a file called originaldatafiles.json. Check that filedir contains multiple folder (not just da folder) b) run a test. At the end of the test, check that dataroot_behat and dataroot_behat/filedir contain the same folders/files as in a). c) drop the behat database with util.php --drop. Check that originaldatafiles.json and filedir has been deleted. d) rerun init. Check that dataroot_behat and dataroot_behat/filedir contain the same folders/files as in a). Setup phpunit(init) a) Do not run any test. Check that in the phpunitdataroot you see a file called originaldatafiles.json. Check that filedir contains multiple folder (not just da folder) b) run a test. At the end of the test, check that dataroot_phpunit and dataroot_phpunit/filedir contain the same folders/files as in a). c) drop the phpunitdatabase with util.php --drop. Check that originaldatafiles.json and filedir has been deleted. d) rerun init. Check that dataroot_phpunit and dataroot_phpunit/filedir contain the same folders/files as in a). Last test a) clone a new site but don't install it. b) delete the mod/assign/feedback/editpdf plugin c) install the site d) run a behat test. It should not crash. Finally, run vendor/bin/phpunit core_test_util_testcase
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-43266-master-nomerge5
    • Story Points (Obsolete):
      13
    • Sprint:
      FRONTEND Sprint 10

      Description

      Edit PDF plugin is adding files to dataroot/filedir during the moodle installation process, the same followed by phpunit and behat. When phpunit and behat resets the dataroot we clean all the contents of filedir so the files are still in the database but not in dataroot, accessing the Edit PDF admin settings page results in a fatal error when looking for the files that are supposed to be there. The files created during the moodle installation should remain in the database after the reset.

      As a solution I propose to store a list of the dataroot files present after the installation, and avoid cleaning those files when resetting the dataroot.

      Adding also 2.5 as affected branch as 3rd party plugins adding files during the installation processes are also affected.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14