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

Behat format moodle_list broken

    XMLWordPrintable

    Details

      Description

      PROBLEM#1. Crash.

      To reproduce:

      execute init.php with --add-core-features-to-theme so all suites are populated.
      execute behat with --format moodle_list --dry-run

      Expected:

      • All features are listed (path:line format).

      Current:

      • Features are listed, but after printing many of them, an error happens:

      $ vendor/bin/behat -vendor/bin/behat --config /Users/stronk7/Sites/moodle_data_gitintegration/master/mariadb_behat/behat/behat.yml --format=moodle_list --dry-run
      /Users/stronk7/git_moodle/integration/cohort/tests/behat/access_visible_cohorts.feature:47
      /Users/stronk7/git_moodle/integration/cohort/tests/behat/access_visible_cohorts.feature:73
      /Users/stronk7/git_moodle/integration/cohort/tests/behat/access_visible_cohorts.feature:100
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:6
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:32
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:42
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:52
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:62
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature:72
      /Users/stronk7/git_moodle/integration/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature:6
      ...
      ...
      /Users/stronk7/git_moodle/integration/course/tests/behat/category_management.feature:160
      /Users/stronk7/git_moodle/integration/course/tests/behat/category_management.feature:180
      /Users/stronk7/git_moodle/integration/course/tests/behat/category_management.feature:215
      /Users/stronk7/git_moodle/integration/course/tests/behat/category_management.feature:242
      /Users/stronk7/git_moodle/integration/course/tests/behat/category_management.feature:338
      PHP Fatal error:  Uncaught Error: Call to a member function getLine() on array in /Users/stronk7/git_moodle/integration/vendor/moodlehq/behat-extension/src/Moodle/BehatExtension/Output/Formatter/MoodleListFormatter.php:147
      Stack trace:
      #0 [internal function]: Moodle\BehatExtension\Output\Formatter\MoodleListFormatter->afterOutlineExample(Object(Behat\Behat\EventDispatcher\Event\AfterOutlineTested), 'tester.outline_...', Object(Behat\Testwork\EventDispatcher\TestworkEventDispatcher))
      #1 /Users/stronk7/git_moodle/integration/vendor/symfony/event-dispatcher/EventDispatcher.php(174): call_user_func(Array, Object(Behat\Behat\EventDispatcher\Event\AfterOutlineTested), 'tester.outline_...', Object(Behat\Testwork\EventDispatcher\TestworkEventDispatcher))
      #2 /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php(39): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'tester.outline_...', Object(Behat\Behat\EventDispatcher\Event\AfterOutlineTested))
      #3 / in /Users/stronk7/git_moodle/integration/vendor/moodlehq/behat-extension/src/Moodle/BehatExtension/Output/Formatter/MoodleListFormatter.php on line 147
       
      Fatal error: Uncaught Error: Call to a member function getLine() on array in /Users/stronk7/git_moodle/integration/vendor/moodlehq/behat-extension/src/Moodle/BehatExtension/Output/Formatter/MoodleListFormatter.php on line 147
       
      Error: Call to a member function getLine() on array in /Users/stronk7/git_moodle/integration/vendor/moodlehq/behat-extension/src/Moodle/BehatExtension/Output/Formatter/MoodleListFormatter.php on line 147
       
      Call Stack:
          0.0002     358704   1. {main}() /Users/stronk7/git_moodle/integration/vendor/behat/behat/bin/behat:0
          0.0139    2333552   2. Symfony\Component\Console\Application->run() /Users/stronk7/git_moodle/integration/vendor/behat/behat/bin/behat:34
          0.0160    2629992   3. Behat\Testwork\Cli\Application->doRun() /Users/stronk7/git_moodle/integration/vendor/symfony/console/Application.php:118
          0.4550   11688296   4. Symfony\Component\Console\Application->doRun() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php:122
          0.4552   11688296   5. Symfony\Component\Console\Application->doRunCommand() /Users/stronk7/git_moodle/integration/vendor/symfony/console/Application.php:187
          0.4552   11688296   6. Symfony\Component\Console\Command\Command->run() /Users/stronk7/git_moodle/integration/vendor/symfony/console/Application.php:820
          0.4556   11690880   7. Behat\Testwork\Cli\Command->execute() /Users/stronk7/git_moodle/integration/vendor/symfony/console/Command/Command.php:256
          0.4640   11772008   8. Behat\Testwork\Tester\Cli\ExerciseController->execute() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Command.php:63
          0.4952   12196408   9. Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:108
          0.4978   12240832  10. Behat\Testwork\Ordering\OrderedExercise->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:149
          0.4979   12240832  11. Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php:80
          0.4979   12240832  12. Behat\Testwork\Tester\Runtime\RuntimeExercise->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php:70
          0.5322   14532896  13. Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php:71
          0.5322   14532896  14. Behat\Testwork\Hook\Tester\HookableSuiteTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php:72
          0.5322   14532896  15. Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php:73
         50.5514   15743944  16. Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php:63
         50.5514   15743944  17. Behat\Behat\Hook\Tester\HookableFeatureTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php:71
         50.5514   15743944  18. Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php:72
         50.8058   15865480  19. Behat\Behat\EventDispatcher\Tester\EventDispatchingOutlineTester->tearDown() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php:85
         50.8086   15876832  20. Behat\Testwork\EventDispatcher\TestworkEventDispatcher->dispatch() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingOutlineTester.php:87
         50.8087   15877608  21. Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() /Users/stronk7/git_moodle/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php:39
         50.8087   15877608  22. call_user_func:{/Users/stronk7/git_moodle/integration/vendor/symfony/event-dispatcher/EventDispatcher.php:174}() /Users/stronk7/git_moodle/integration/vendor/symfony/event-dispatcher/EventDispatcher.php:174
         50.8087   15877608  23. Moodle\BehatExtension\Output\Formatter\MoodleListFormatter->afterOutlineExample() /Users/stronk7/git_moodle/integration/vendor/symfony/event-dispatcher/EventDispatcher.php:174
      

      PROBLEM#2. behat --help.

      Unless I'm wrong, the help for the "moodle_list" and moodle_stepcount" formats is swapped incorrectly.

      BTW, somehow related executing --format moodle_stepcount --dry-run seems to work ok, without the PROBLEM#1 above, just in case that helps to find differences.

      Detected with master (3.2), not sure if the same happens with 3.1 or is isolated to only 3.2 and the changes produced to better support suites, themes and tags.

      Ciao

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jan/17