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

Add support for behat_profiles and improved exit code for parallel runs

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • Hide
      1. Exit code of parallel run is bit masked to reflect failed run.
      1. Modify behat.yml and leave only 3 feature files.
      2. Initialise behat with 3 runs. (php admin/tool/behat/cli/init.php -j=3)
      3. Modify 1st and 3rd feature file so they fail.
      4. Run parallel behat and check exit code. It should be 5 (php admin/tool/behat/cli/run.php) (echo $?)
      5. Modify 2nd feature file, so it fails
      6. Run parallel behat and check exit code is 7 (php admin/tool/behat/cli/run.php) (echo $?)
      2. Test $CFG->behat_profiles and $CFG->behat_config
      1. Set following in your config.php and ensure phantomjs and chrome profiles are set in behat.yml
      2. Start runs with both --profile=phantomjs and --profile=chrome

        $CFG->behat_profiles = array(
            'phantomjs' => array(
                'browser' => 'phantomjs',
                'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',
                'wd_host' => 'http://127.0.0.1:4443/wd/hub',
                'capabilities' => array(
                    'platform' => 'Linux',
                    'version' => 2.1
                )
            )
        );
         
        $CFG->behat_config = array(
            'chrome' => array(
               'extensions' => array(
                   'Behat\MinkExtension\Extension' => array(
                       'selenium2' => array(
                           'browser' => 'chrome',
                       )
                   )
               )
            )
        );
        

      Show
      1. Exit code of parallel run is bit masked to reflect failed run. Modify behat.yml and leave only 3 feature files. Initialise behat with 3 runs. (php admin/tool/behat/cli/init.php -j=3) Modify 1st and 3rd feature file so they fail. Run parallel behat and check exit code. It should be 5 (php admin/tool/behat/cli/run.php) (echo $?) Modify 2nd feature file, so it fails Run parallel behat and check exit code is 7 (php admin/tool/behat/cli/run.php) (echo $?) 2. Test $CFG->behat_profiles and $CFG->behat_config Set following in your config.php and ensure phantomjs and chrome profiles are set in behat.yml Start runs with both --profile=phantomjs and --profile=chrome $CFG->behat_profiles = array( 'phantomjs' => array( 'browser' => 'phantomjs', 'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs', 'wd_host' => 'http://127.0.0.1:4443/wd/hub', 'capabilities' => array( 'platform' => 'Linux', 'version' => 2.1 ) ) );   $CFG->behat_config = array( 'chrome' => array( 'extensions' => array( 'Behat\MinkExtension\Extension' => array( 'selenium2' => array( 'browser' => 'chrome', ) ) ) ) );

      While fixing MDL-46891, it was decided to have a moodle specific profile for behat which is:

      1. understood by every Moodle version
      2. Easy to remember

      Also, it was found that it would be nice to have a exit code for parallel runs to notify which run failed.

      This issue is to backport above 2 to stables.

            rajeshtaneja Rajesh Taneja
            rajeshtaneja Rajesh Taneja
            Andrew Lyons Andrew Lyons
            David Monllaó David Monllaó
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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