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

Allow acceptance tests to be executed against custom cache stores.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Hi.
      It's my last week here, on Friday I finish.
      Unfortunately you the tester are going to hate me on my last week....

      Enjoy

      You have to do this locally sorry, CI servers can't do this for you as its imperative you check locally.

      Setup:

      1. Make sure you have MongoDB and its PHP extension installed.
      2. Make sure you have Memcached and its PHP extension installed.
      3. Ensure you don't have either of these set in your config.php
        • TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH
        • TEST_CACHE_USING_APPLICATION_STORE
      4. Add the following to your config.php
        • $CFG->behat_extraallowedsettings = array('perfdebug');
        • $CFG->perfdebug = 15;
        • $CFG->altcacheconfigpath = '/tmp/testing-45699.cache';

      Test the default.

      1. In your browser browse to your behat site
      2. Scroll down and verify you see "cachestore_file" being used caches (in the perf debug info)
      3. Initialise phpunit
      4. Initialise behat
      5. Run full phpunit
      6. Run behat --name "Test course pagination"
      7. Make sure both complete successfully.

      Test altcacheconfig

      1. Add define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true); to your config.php
      2. Browse to your site and log in as admin.
      3. Browse to Site administration > Plugins > Caching > Cache configuration
      4. Set up a MongoDB cache store instance using the defaults
      5. Map your MongoDB cache store as the default application store
      6. Verify that you see MongoDB being used as the cache store for all application caches (in the perfdebug)
      7. Run full phpunit
      8. Run behat --name "Test course pagination"
      9. Make sure both complete successfully.

      Test specific cache testing

      1. Remove the TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH from your config.php
      2. Add the following to your config.php
        • define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');
        • define('TEST_CACHE_USING_APPLICATION_STORE', 'memcached');
      3. Delete moodledata/muc/config.php
      4. Browse to your site.
      5. Check if the perfconf that you see memcached being used for application caches.
      6. Drop and initiailise phpunit
      7. Drop and initiailise behat
      8. Run full phpunit
      9. Run behat --name "Test course pagination"
      10. Make sure both complete successfully.

      Verify normal use (clean, default site, without any phpunit/behat CFG settings).

      1. Verify Moodle 2.8 and master install ok (CLI and web).
      2. Verify Moodle 2.8 and master upgrade ok (from 2.7, CLI and web).
      3. Visit places using caches and verify there are no problems (groups, admin settings...).
      4. Verify cache configuration works and can add instances, modify them...exploratory testing.
      Show
      Hi. It's my last week here, on Friday I finish. Unfortunately you the tester are going to hate me on my last week.... Enjoy You have to do this locally sorry, CI servers can't do this for you as its imperative you check locally. Setup: Make sure you have MongoDB and its PHP extension installed. Make sure you have Memcached and its PHP extension installed. Ensure you don't have either of these set in your config.php TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH TEST_CACHE_USING_APPLICATION_STORE Add the following to your config.php $CFG->behat_extraallowedsettings = array('perfdebug'); $CFG->perfdebug = 15; $CFG->altcacheconfigpath = '/tmp/testing-45699.cache'; Test the default. In your browser browse to your behat site Scroll down and verify you see "cachestore_file" being used caches (in the perf debug info) Initialise phpunit Initialise behat Run full phpunit Run behat --name "Test course pagination" Make sure both complete successfully. Test altcacheconfig Add define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true); to your config.php Browse to your site and log in as admin. Browse to Site administration > Plugins > Caching > Cache configuration Set up a MongoDB cache store instance using the defaults Map your MongoDB cache store as the default application store Verify that you see MongoDB being used as the cache store for all application caches (in the perfdebug) Run full phpunit Run behat --name "Test course pagination" Make sure both complete successfully. Test specific cache testing Remove the TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH from your config.php Add the following to your config.php define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211'); define('TEST_CACHE_USING_APPLICATION_STORE', 'memcached'); Delete moodledata/muc/config.php Browse to your site. Check if the perfconf that you see memcached being used for application caches. Drop and initiailise phpunit Drop and initiailise behat Run full phpunit Run behat --name "Test course pagination" Make sure both complete successfully. Verify normal use (clean, default site, without any phpunit/behat CFG settings). Verify Moodle 2.8 and master install ok (CLI and web). Verify Moodle 2.8 and master upgrade ok (from 2.7, CLI and web). Visit places using caches and verify there are no problems (groups, admin settings...). Verify cache configuration works and can add instances, modify them...exploratory testing.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull Master Branch:
      45699-29
    • Pull Master Diff URL:

      Description

      This is a follow on from MDL-45513 where we enabled phpunit tests to be run against custom cache stores using either $CFG->altcacheconfigpath OR special defines to be used (see cache/README.md)

      It would be nice to be able to run behat tests against specific cache stores and cache configurations.
      This would both facilitate faster runs (hopefully) as well as allowing sites a means by which to test cache configuration and perhaps even its performance in a limited sense.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              samhemelryk Sam Hemelryk
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jan/15