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

Fix Redis session tests

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.3, 3.4, 3.5.6, 3.6.4, 3.7
    • 3.5.7, 3.6.5, 3.7.1
    • Unit tests
    • PHP 7.2+
    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-60978-master
    • Hide
      Requirements:
      1. Please set php version to 7.2
      2. Make sure that the redis PHP extension is also installed. If not installed (e.g. on Ubuntu/Linuxmint):

        sudo apt install -y php-redis
        sudo service apache2 restart
        

      Test
      1. Spin up a redis server:

        docker run --name my-redis --network host -d redis 

      2. Edit your config.php to add:

        define('TEST_SESSION_REDIS_HOST', '127.0.0.1');
        

      3. Run phpunit on the redis sessions:

        ./vendor/bin/phpunit lib/tests/session_redis_test.php
        

        1. Confirm pass (not skip)
      4. Run a full phpunit run without process isolation:

        ./vendor/bin/phpunit
        

        1. Confirm pass of entire suite
      Show
      Requirements: Please set php version to 7.2 Make sure that the redis PHP extension is also installed. If not installed (e.g. on Ubuntu/Linuxmint): sudo apt install -y php-redis sudo service apache2 restart Test Spin up a redis server: docker run --name my-redis --network host -d redis Edit your config.php to add: define('TEST_SESSION_REDIS_HOST', '127.0.0.1'); Run phpunit on the redis sessions: ./vendor/bin/phpunit lib/tests/session_redis_test.php Confirm pass (not skip) Run a full phpunit run without process isolation: ./vendor/bin/phpunit Confirm pass of entire suite

    Description

      In MDL-60951 we disabled the redis unit tests on travis because we were seeing failures due to https://bugs.php.net/bug.php?id=75628

      This bug makes it impossible to unit test session handlers on php 7.2 so until it's fixed upstream and travis update to a "fixed" php version, we had to disable those tests.

      This issue is a followup to re-enable redis when the upstream bug is fixed.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              damyon Damyon Wiese
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Jake Dallimore Jake Dallimore
              Janelle Barcega Janelle Barcega
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Jul/19

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 25 minutes
                  1d 1h 25m