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

Failing unit test on Redis 4.0

XMLWordPrintable

    • MOODLE_31_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_31_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-63050-master
    • Hide
      1. Run a redis server:

        docker run -d -p 6379:6379 --name redis redis
        

      2. Add redis configuration to config.php:

        $redistestname = '127.0.0.1';
        define('TEST_SESSION_REDIS_HOST', $redistestname);
        define('TEST_CACHESTORE_REDIS_TESTSERVERS', $redistestname);
        

      3. Install redis 3.1.6:

        pecl install redis-3.1.6
        

      4. Run phpunit tests for redis:

        ./vendor/bin/phpunit lib/tests/session_redis_test.php
        ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php
        

        1. Verify no failure
      5. Upgrade to Redis 4.1.0

        pecl install redis-4.1.0
        

      6. Run phpunit tests for redis:

        ./vendor/bin/phpunit lib/tests/session_redis_test.php
        ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php
        

        1. Verify no failure
      Show
      Run a redis server: docker run -d -p 6379:6379 --name redis redis Add redis configuration to config.php: $redistestname = '127.0.0.1'; define('TEST_SESSION_REDIS_HOST', $redistestname); define('TEST_CACHESTORE_REDIS_TESTSERVERS', $redistestname); Install redis 3.1.6: pecl install redis-3.1.6 Run phpunit tests for redis: ./vendor/bin/phpunit lib/tests/session_redis_test.php ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php Verify no failure Upgrade to Redis 4.1.0 pecl install redis-4.1.0 Run phpunit tests for redis: ./vendor/bin/phpunit lib/tests/session_redis_test.php ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php Verify no failure

      PHP Redis 4.0 introduced a change whereby the exists function returns a count, rather than a bool.

      We need to update the session_exists function accordingly.

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Jake Dallimore Jake Dallimore
            Victor Déniz Falcón Victor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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