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

Behat does not run under MS windows (unless you use an msysgit window)

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • wip-mdl-52721
    • Hide
      Before patch:
      1. Initialise behat (php admin/tool/behat/cli/init.php)
      2. Make a copy of behat.yml, as we need to compare it later.
      3. Build phpunit.xml (php admin/tool/phpunit/cli/util.php --buildcomponentconfigs)
      4. Make a copy of it as we need to compare tests included.
      After Patch:
      1. Copy lib/tests folder to vendor or node_module folder
      2. Initialise behat (php admin/tool/behat/cli/init.php)
      3. Make sure you don't see tests included from vendor or node_modules in behat.yml
      4. Compare it with behat.yml (before patch) and make sure they are same.
      5. Build phpunit.xml (php admin/tool/phpunit/cli/util.php --buildcomponentconfigs)
      6. Compare it with phpunit.xml (before patch) and ensure they are same.
      Test 2: Install and run behat parallel run ensure behat.yml doesn't have multiple features with same name
      1. php admin/tool/behat/cli/init.php -j=4
      2. php admin/tool/behat/cli/run.php
      3. Check behat.yml for all 4 runs and ensure feature and context files are unique.
      Test 3:
      1. Create a link to moodle within moodle (ln -s hello PATH_TO_YOUR_MOODLE_SITE)
      2. Initialise behat and run, check behat.yml and make sure tests are not included from hello directory link.
      3. Initialise behat with parallel run and run, check behat.yml for every run and make sure only features are unique and not included from other link directories within moodle.

      Note: Test above on windows as well.

      Show
      Before patch: Initialise behat (php admin/tool/behat/cli/init.php) Make a copy of behat.yml, as we need to compare it later. Build phpunit.xml (php admin/tool/phpunit/cli/util.php --buildcomponentconfigs) Make a copy of it as we need to compare tests included. After Patch: Copy lib/tests folder to vendor or node_module folder Initialise behat (php admin/tool/behat/cli/init.php) Make sure you don't see tests included from vendor or node_modules in behat.yml Compare it with behat.yml (before patch) and make sure they are same. Build phpunit.xml (php admin/tool/phpunit/cli/util.php --buildcomponentconfigs) Compare it with phpunit.xml (before patch) and ensure they are same. Test 2: Install and run behat parallel run ensure behat.yml doesn't have multiple features with same name php admin/tool/behat/cli/init.php -j=4 php admin/tool/behat/cli/run.php Check behat.yml for all 4 runs and ensure feature and context files are unique. Test 3: Create a link to moodle within moodle (ln -s hello PATH_TO_YOUR_MOODLE_SITE) Initialise behat and run, check behat.yml and make sure tests are not included from hello directory link. Initialise behat with parallel run and run, check behat.yml for every run and make sure only features are unique and not included from other link directories within moodle. Note: Test above on windows as well.

      Install Moodle on MS Windows.

      Try to run php admin/tool/behat/cli/init.php in either a Windows cmd prompt window, or a Cygwin bash window.

      Expected result: It works. (This was the case until recently, and still works in 2.9.x and 3.0.x.)

      Acutal result:

      C:\Users\tjh238\workspace\moodle_head>  php admin/tool/behat/cli/init.php
      You are already using composer version 03299ff075236be27be356498d6c64def973fe41.
      Loading composer repositories with package information
      Installing dependencies (including require-dev) from lock file
      Nothing to install or update
      Generating autoload files
      Behat test environment already installed
      Default exception handler: Exception - RecursiveDirectoryIterator::__construct([dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie,[dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie): The system cannot find the path specified. (code: 3) Debug:
      Error code: generalexceptionmessage
      * line 133 of \lib\testing\classes\tests_finder.php: UnexpectedValueException thrown
      * line ? of unknownfile: call to RecursiveDirectoryIterator->__construct()
      * line ? of unknownfile: call to RecursiveDirectoryIterator->getChildren()
      * line 133 of \lib\testing\classes\tests_finder.php: call to FilterIterator->next()
      * line 47 of \lib\testing\classes\tests_finder.php: call to tests_finder::get_all_directories_with_tests()
      * line 72 of \lib\behat\classes\behat_config_manager.php: call to tests_finder::get_components_with_tests()
      * line 214 of \lib\behat\classes\util.php: call to behat_config_manager::update_config_file()
      * line 172 of \admin\tool\behat\cli\util_single_run.php: call to behat_util::start_test_mode()
       
      !!! Exception - RecursiveDirectoryIterator::__construct([dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie,[dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie): The system cannot find the path specified. (code: 3) !!!
      !!
      Error code: generalexceptionmessage !!
      !! Stack trace: * line 133 of \lib\testing\classes\tests_finder.php: UnexpectedValueException thrown
      * line ? of unknownfile: call to RecursiveDirectoryIterator->__construct()
      * line ? of unknownfile: call to RecursiveDirectoryIterator->getChildren()
      * line 133 of \lib\testing\classes\tests_finder.php: call to FilterIterator->next()
      * line 47 of \lib\testing\classes\tests_finder.php: call to tests_finder::get_all_directories_with_tests()
      * line 72 of \lib\behat\classes\behat_config_manager.php: call to tests_finder::get_components_with_tests()
      * line 214 of \lib\behat\classes\util.php: call to behat_config_manager::update_config_file()
      * line 172 of \admin\tool\behat\cli\util_single_run.php: call to behat_util::start_test_mode()
       !!
      Error enabling site
       
      C:\Users\tjh238\workspace\moodle_head>  php admin/tool/behat/cli/init.php
      You are already using composer version 03299ff075236be27be356498d6c64def973fe41.
      Loading composer repositories with package information
      Installing dependencies (including require-dev) from lock file
      Nothing to install or update
      Generating autoload files
      Behat test environment already installed
      |\\tests\\behat\\.*\.feature$|
      Default exception handler: Exception - RecursiveDirectoryIterator::__construct([dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie,[dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie): The system cannot find the path specified. (code: 3) Debug:
      Error code: generalexceptionmessage
      * line 134 of \lib\testing\classes\tests_finder.php: UnexpectedValueException thrown
      * line ? of unknownfile: call to RecursiveDirectoryIterator->__construct()
      * line ? of unknownfile: call to RecursiveDirectoryIterator->getChildren()
      * line 134 of \lib\testing\classes\tests_finder.php: call to FilterIterator->next()
      * line 47 of \lib\testing\classes\tests_finder.php: call to tests_finder::get_all_directories_with_tests()
      * line 72 of \lib\behat\classes\behat_config_manager.php: call to tests_finder::get_components_with_tests()
      * line 214 of \lib\behat\classes\util.php: call to behat_config_manager::update_config_file()
      * line 172 of \admin\tool\behat\cli\util_single_run.php: call to behat_util::start_test_mode()
       
      !!! Exception - RecursiveDirectoryIterator::__construct([dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie,[dirroot]\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie): The system cannot find the path specified. (code: 3) !!!
      !!
      Error code: generalexceptionmessage !!
      !! Stack trace: * line 134 of \lib\testing\classes\tests_finder.php: UnexpectedValueException thrown
      * line ? of unknownfile: call to RecursiveDirectoryIterator->__construct()
      * line ? of unknownfile: call to RecursiveDirectoryIterator->getChildren()
      * line 134 of \lib\testing\classes\tests_finder.php: call to FilterIterator->next()
      * line 47 of \lib\testing\classes\tests_finder.php: call to tests_finder::get_all_directories_with_tests()
      * line 72 of \lib\behat\classes\behat_config_manager.php: call to tests_finder::get_components_with_tests()
      * line 214 of \lib\behat\classes\util.php: call to behat_config_manager::update_config_file()
      * line 172 of \admin\tool\behat\cli\util_single_run.php: call to behat_util::start_test_mode()
       !!
      Error enabling site
      

      The problem is the path

      dir C:\Users\tjh238\workspace\moodle_head\node_modules\grunt-contrib-uglify\node_modules\maxmin\node_modules\pretty-bytes\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\pinkie-promise\node_modules\pinkie

      That has 259 chars. If you strip off the \pinkie (252 chars), the command runs.

      Strangely, it works in an msysgit command prompt.

            rajeshtaneja Rajesh Taneja
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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