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

Add unit tests for cache stores

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      Hide
      1. Run unit test combined: vendor/bin/phpunit
      2. Run individual unit tests separately:
        • vendor/bin/phpunit cache/tests/cache_test.php
        • vendor/bin/phpunit cache/stores/file/tests/file_test.php
        • vendor/bin/phpunit cache/stores/memcache/tests/memcache_test.php
        • vendor/bin/phpunit cache/stores/memcached/tests/memcached_test.php
        • vendor/bin/phpunit cache/stores/mongodb/tests/mongodb_test.php
        • vendor/bin/phpunit cache/stores/session/tests/session_test.php
        • vendor/bin/phpunit cache/stores/static/tests/static_test.php
      Show
      Run unit test combined: vendor/bin/phpunit Run individual unit tests separately: vendor/bin/phpunit cache/tests/cache_test.php vendor/bin/phpunit cache/stores/file/tests/file_test.php vendor/bin/phpunit cache/stores/memcache/tests/memcache_test.php vendor/bin/phpunit cache/stores/memcached/tests/memcached_test.php vendor/bin/phpunit cache/stores/mongodb/tests/mongodb_test.php vendor/bin/phpunit cache/stores/session/tests/session_test.php vendor/bin/phpunit cache/stores/static/tests/static_test.php
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-38247-m25

      Description

      It would be hugely beneficial to have unit tests available for cache stores.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            samhemelryk Sam Hemelryk added a comment -

            Ok putting this up for peer-review now.

            This patch both implements unit tests and alters cache stores slightly so that they pass the unit tests.
            Turns out there was inconsistency when dealing with the delete method and that the mongodb store has changed in recent versions.

            Many thanks
            Sam

            Show
            samhemelryk Sam Hemelryk added a comment - Ok putting this up for peer-review now. This patch both implements unit tests and alters cache stores slightly so that they pass the unit tests. Turns out there was inconsistency when dealing with the delete method and that the mongodb store has changed in recent versions. Many thanks Sam
            Hide
            samhemelryk Sam Hemelryk added a comment -

            As a point of consideration we are going to need to decide if this should be backported.

            Show
            samhemelryk Sam Hemelryk added a comment - As a point of consideration we are going to need to decide if this should be backported.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Submitting for integration review. Sorry peer-review process was taking too long.

            Show
            samhemelryk Sam Hemelryk added a comment - Submitting for integration review. Sorry peer-review process was taking too long.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks! (master only)

            +1 to create backport request. All fixes seem logic to be backported IMO.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (master only) +1 to create backport request. All fixes seem logic to be backported IMO.
            Hide
            phalacee Jason Fowler added a comment -

            Don't have memcache or mongodb installed...

            Show
            phalacee Jason Fowler added a comment - Don't have memcache or mongodb installed...
            Hide
            phalacee Jason Fowler added a comment -

            Running vendor/bin/phpunit cache/stores/memcached/tests/memcached_test.php causes my machine to segfault and core dump.

            Show
            phalacee Jason Fowler added a comment - Running vendor/bin/phpunit cache/stores/memcached/tests/memcached_test.php causes my machine to segfault and core dump.
            Hide
            phalacee Jason Fowler added a comment -

            Test passed. Ubuntu 12.04 has a fault with memcached, so Damyon tested on a 12.10 VM for me. Thanks Damyon.

            Show
            phalacee Jason Fowler added a comment - Test passed. Ubuntu 12.04 has a fault with memcached, so Damyon tested on a 12.10 VM for me. Thanks Damyon.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities.

            Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied).

            Thanks, closing as fixed!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities. Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied). Thanks, closing as fixed!

              People

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

                Dates

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