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

Add a script to reinstall quickly the behat test site

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Drop your current behat test site php admin/tool/behat/cli/util.php --drop
      2. Run php admin/tool/behat/cli/util.php --diag
      3. You SHOULD see a message stating that you need to install your behat test site
      4. Delete completely your $CFG->behat_dataroot directory, you don't need to change the $CFG->behat_dataroot value
      5. Run php admin/tool/behat/cli/init.php
      6. Your test site SHOULD be installed and you SHOULD see
        1. The table names
        2. A Acceptance tests site installed message
        3. A Acceptance tests environment enabled, to run the tests use: followed by the command
      7. Run php admin/tool/behat/cli/util.php --diag
      8. You SHOULD NOT see any output
      9. Edit your $CFG->dirroot/version.php and change the moodle version to 2014010100 or something in the future (while this is changed don't access your normal moodle site or you will have to upgrade the site and edit the database when the tests are finished)
      10. Run again php admin/tool/behat/cli/init.php
      11. You SHOULD see the ........... with Acceptance tests site dropped followed by the installation and enable output you have seen before
      12. Run php admin/tool/behat/cli/util.php --diag
      13. You SHOULD NOT see any output
      14. Restore your $CFG->dirroot/version.php git checkout version.php
      15. Run php admin/tool/behat/cli/util.php --drop
      16. Browse your regular moodle site and go to Site administration -> Development -> Acceptance testing
      17. You SHOULD see a list of steps
      18. Delete your $CFG->dirroot/vendor and $CFG->dirroot/composer.lock files, but keep composer.phar
      19. Browse your regular moodle site and go to Site administration -> Development -> Acceptance testing
      20. You SHOULD see "Something is wrong with the setup, ensure you ran the composer installer and vendor/bin/behat file has execution permissions. More info in http://docs.moodle.org/dev/Acceptance_testing#Installation"
      21. Run php admin/tool/behat/cli/util.php --diag
      22. You SHOULD see "Something is wrong with the setup, ensure you ran the composer installer and vendor/bin/behat file has execution permissions. More info in http://docs.moodle.org/dev/Acceptance_testing#Installation"
      23. Run again php admin/tool/behat/cli/init.php
      24. It SHOULD install composer dependencies, install the test site and enable the behat test environment according to your config.php values
      25. Run php admin/tool/behat/cli/util.php --diag
      26. You SHOULD NOT see any output
      27. Run the test suite
      28. All tests SHOULD pass

      We are not testing without composer.phar because it can fail depending on different things (http://docs.moodle.org/dev/Acceptance_testing#Installation)

      Show
      Drop your current behat test site php admin/tool/behat/cli/util.php --drop Run php admin/tool/behat/cli/util.php --diag You SHOULD see a message stating that you need to install your behat test site Delete completely your $CFG->behat_dataroot directory, you don't need to change the $CFG->behat_dataroot value Run php admin/tool/behat/cli/init.php Your test site SHOULD be installed and you SHOULD see The table names A Acceptance tests site installed message A Acceptance tests environment enabled, to run the tests use: followed by the command Run php admin/tool/behat/cli/util.php --diag You SHOULD NOT see any output Edit your $CFG->dirroot/version.php and change the moodle version to 2014010100 or something in the future (while this is changed don't access your normal moodle site or you will have to upgrade the site and edit the database when the tests are finished) Run again php admin/tool/behat/cli/init.php You SHOULD see the ........... with Acceptance tests site dropped followed by the installation and enable output you have seen before Run php admin/tool/behat/cli/util.php --diag You SHOULD NOT see any output Restore your $CFG->dirroot/version.php git checkout version.php Run php admin/tool/behat/cli/util.php --drop Browse your regular moodle site and go to Site administration -> Development -> Acceptance testing You SHOULD see a list of steps Delete your $CFG->dirroot/vendor and $CFG->dirroot/composer.lock files, but keep composer.phar Browse your regular moodle site and go to Site administration -> Development -> Acceptance testing You SHOULD see "Something is wrong with the setup, ensure you ran the composer installer and vendor/bin/behat file has execution permissions. More info in http://docs.moodle.org/dev/Acceptance_testing#Installation " Run php admin/tool/behat/cli/util.php --diag You SHOULD see "Something is wrong with the setup, ensure you ran the composer installer and vendor/bin/behat file has execution permissions. More info in http://docs.moodle.org/dev/Acceptance_testing#Installation " Run again php admin/tool/behat/cli/init.php It SHOULD install composer dependencies, install the test site and enable the behat test environment according to your config.php values Run php admin/tool/behat/cli/util.php --diag You SHOULD NOT see any output Run the test suite All tests SHOULD pass We are not testing without composer.phar because it can fail depending on different things ( http://docs.moodle.org/dev/Acceptance_testing#Installation )
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38007_master

      Description

      Requested by Michael here: https://tracker.moodle.org/browse/MDL-37768?focusedCommentId=202820&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-202820

      When upgrading to latest stable or integration versions the behat tests site has to be reinstalled according to the codebase version. This is done by:

      • php admin/tool/behat/cli/util.php --drop
      • php admin/tool/behat/cli/util.php --install

      And also enable if required

      • php admin/tool/behat/cli/util.php --enable

      A new script following what admin/tool/phpunit/cli/init.php does can help with it

        Attachments

          Activity

            People

            Assignee:
            dmonllao David Monllaó
            Reporter:
            salvetore Michael de Raadt
            Peer reviewer:
            Mark Nelson Mark Nelson
            Integrator:
            Aparup Banerjee Aparup Banerjee
            Tester:
            Rajesh Taneja Rajesh Taneja
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/May/13