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

Remove Behat skip-passed legacy option

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • Hide
      1. Init behat: php admin/tool/behat/cli/init.php
      2. Run: vendor/bin/behat --help
      3. Verify that the --skip-passed option is not shown.
      4. Run behat using the --skip-passed option: vendor/bin/behat --skip-passed
      5. Verify that errors with: The "--skip-passed" option does not exist.
      6. Edit the mod/label/tests/behat/label_idnumber.feature and apply these changes:

        --- a/mod/label/tests/behat/label_idnumber.feature
        +++ b/mod/label/tests/behat/label_idnumber.feature
        @@ -33,4 +33,4 @@ Feature: set label idnumber
             And I am on the "Label with ID number set" "label activity editing" page logged in as teacher
             And I expand all fieldsets
             And I should see "ID number" in the "Common module settings" "fieldset"
        -    And the field "ID number" matches value "C1LABEL1"
        +    And the field "ID number" matches value "NONOC1LABEL1"
        

      7. Run behat with params: --profile headlesschrome --suite default --tags @mod_label
      8. Verify that you get 5 scenarios passing and 1 failing.
      9. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun
      10. Verify that you get no scenarios passing and 1 failing.
      11. Edit the mod/label/tests/behat/label_idnumber.feature and revert the changes by removing the "NONO" that we have added some steps above.
      12. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun
      13. Verify that you get 1 scenario passing and no scenarios failing.
      14. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun
      15. Verify that you get 6 scenarios passing and no scenarios failing.
      Show
      Init behat: php admin/tool/behat/cli/init.php Run: vendor/bin/behat --help Verify that the --skip-passed option is not shown. Run behat using the --skip-passed option: vendor/bin/behat --skip-passed Verify that errors with: The "--skip-passed" option does not exist. Edit the mod/label/tests/behat/label_idnumber.feature and apply these changes: --- a/mod/label/tests/behat/label_idnumber.feature +++ b/mod/label/tests/behat/label_idnumber.feature @@ -33,4 +33,4 @@ Feature: set label idnumber And I am on the "Label with ID number set" "label activity editing" page logged in as teacher And I expand all fieldsets And I should see "ID number" in the "Common module settings" "fieldset" - And the field "ID number" matches value "C1LABEL1" + And the field "ID number" matches value "NONOC1LABEL1" Run behat with params: --profile headlesschrome --suite default --tags @mod_label Verify that you get 5 scenarios passing and 1 failing. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun Verify that you get no scenarios passing and 1 failing. Edit the mod/label/tests/behat/label_idnumber.feature and revert the changes by removing the " NONO " that we have added some steps above. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun Verify that you get 1 scenario passing and no scenarios failing. Run behat with params: --profile headlesschrome --suite default --tags @mod_label --rerun Verify that you get 6 scenarios passing and no scenarios failing.

      While looking to the moodle behat extension in another issue it was detected that we still have there the --skip-passed option.

      That option was added in early Behat 3.1.x - 3.2.x days, because the --rerun option built-in Behat was not working ok and it was impossible to just rerun failed tests (something that now is solved and we use every day).

      This --skip-passed option was implemented in the extension @ MDL-55853. Basically what it does is to create a list of passed scenarios and, in next executions, skip all them. As said, this was a workaround to the --rerun option that was not working ok in the past.

      Finally, upstream --rerun behaviour was fixed for Behat 3.2.0, see https://github.com/Behat/Behat/pull/933 and MDL-55769, so we did stop needing the --skip-passed workaround.

      So:

      • We are not using the --skip-passed option since 2016.
      • The upstream --rerun option provides exactly the same and we are using it.
      • I'm sure that (near) nobody is using the old option because it's not documented (in fact I had forgotten about it completely).
      • Hence, it's superfluous code that can be removed.

      Plan:

      • Basically, revert what was done by this commit in the moodle-behat-extension (that now is bundled in core).
      • Document the removal of the option, just in case somebody is still using it. I've searched out there, in docs, github, google.. and haven't found any reference other that the issues and PRs commented above.
      • Verify that everything continues working ok (core, moodle-plugin-ci...)

      This can be done master only, as far as it's not used, we can leave it dying in stable branches.

      Ciao

        1. step_13.png
          139 kB
          Huong Nguyen
        2. step_15.png
          140 kB
          Huong Nguyen
        3. step_5.png
          64 kB
          Huong Nguyen
        4. step_8.png
          213 kB
          Huong Nguyen

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Petr Skoda Petr Skoda
            Andrew Lyons Andrew Lyons
            Huong Nguyen Huong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 50 minutes
                3h 50m

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