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

Running behat test throws php warning about undefined SESSION

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Install or update your behat test site php admin/tool/behat/cli/init.php from dirroot
      2. Run the behat test suite adding * --tags @mod_survey* to avoid running all the tests, something like vendor/bin/behat --config /path/to/behat_dataroot/behat/behat.yml --tags @mod_survey
      3. You SHOULD NOT see any warning
      Show
      Install or update your behat test site php admin/tool/behat/cli/init.php from dirroot Run the behat test suite adding * --tags @mod_survey* to avoid running all the tests, something like vendor/bin/behat --config /path/to/behat_dataroot/behat/behat.yml --tags @mod_survey You SHOULD NOT see any warning
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38828_master

      Description

      Running behat tests (installed following http://docs.moodle.org/dev/Acceptance_testing#Installation), they show this PHP warning twice.

      Warning: Creating default object from empty value in /cache/stores/session/lib.php on line 55
       
      Call Stack:
          0.0002     233632   1. {main}() /vendor/behat/behat/bin/behat:0
          0.0076    1257128   2. Symfony\Component\Console\Application->run() /vendor/behat/behat/bin/behat:32
          0.0102    1572112   3. Behat\Behat\Console\BehatApplication->doRun() /vendor/symfony/console/Symfony/Component/Console/Application.php:106
          0.1295    7741744   4. Symfony\Component\Console\Application->doRun() /vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php:68
          0.1297    7743088   5. Symfony\Component\Console\Command\Command->run() /vendor/symfony/console/Symfony/Component/Console/Application.php:193
          0.2155   10425616   6. Behat\Behat\Console\Command\BehatCommand->execute() /vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
          0.4468   31468544   7. Behat\Behat\Console\Command\BehatCommand->runFeatures() /vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php:128
          0.5587   32482168   8. Behat\Gherkin\Node\AbstractNode->accept() /vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php:150
          0.5587   32482200   9. Behat\Behat\Tester\FeatureTester->visit() /vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php:42
          0.5599   32526064  10. Behat\Gherkin\Node\AbstractNode->accept() /vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php:88
          0.5599   32526096  11. Behat\Behat\Tester\ScenarioTester->visit() /vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php:42
          0.5601   32546808  12. Symfony\Component\EventDispatcher\EventDispatcher->dispatch() /vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php:69
          0.5601   32547352  13. Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() /vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:53
          0.5602   32548272  14. call_user_func() /vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:164
          0.5602   32548304  15. Behat\Behat\Hook\HookDispatcher->beforeScenario() /vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:164
          0.5602   32548384  16. Behat\Behat\Hook\HookDispatcher->fireHooks() /vendor/behat/behat/src/Behat/Behat/Hook/HookDispatcher.php:162
          0.5602   32549552  17. Behat\Behat\Hook\Annotation\ScenarioHook->run() /vendor/behat/behat/src/Behat/Behat/Hook/HookDispatcher.php:276
          0.5603   32550888  18. call_user_func() /vendor/behat/behat/src/Behat/Behat/Hook/Annotation/ScenarioHook.php:65
          0.5603   32550920  19. behat_hooks->before_scenario() /vendor/behat/behat/src/Behat/Behat/Hook/Annotation/ScenarioHook.php:65
          1.0539   49095256  20. testing_util::reset_dataroot() /lib/tests/behat/behat_hooks.php:120
          1.0679   48903328  21. cache_helper::purge_all() /lib/testing/classes/util.php:607
          1.1706   52324368  22. cache_helper::purge_store() /cache/classes/helper.php:419
          1.1708   52326824  23. cachestore_session->initialise() /cache/classes/helper.php:451
          1.1708   52327056  24. session_data_store::register_store_id() /cache/stores/session/lib.php:181
      

      Seems it's a matter of initialize the SESSION object somewhere, surely in behat warmup... but as far as I'm not sure... adding both David Mo and Sam H here... ciao

      Note the tests complete ok, just we should take rid of any warning coz the CI servers catch them as errors in the execution.

      Ciao

        Attachments

          Activity

            People

            Assignee:
            dmonllao David Monllaó
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Sam Hemelryk Sam Hemelryk
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

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