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

Fix Redis session tests

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Minor
    • 3.5.7, 3.6.5, 3.7.1
    • 3.3.3, 3.4, 3.5.6, 3.6.4, 3.7
    • 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

        1. image-2019-06-26-18-51-03-724.png
          584 kB
          Janelle Barcega
        2. screenshot-1.png
          259 kB
          Janelle Barcega

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              damyon Damyon Wiese
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Jake Dallimore Jake Dallimore
              Janelle Barcega Janelle Barcega
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                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

                  Clockify

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