56 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
093c161d46 Merge branch '45699-29' of git://github.com/samhemelryk/moodle
Conflicts:
	cache/upgrade.txt
2014-12-23 02:01:36 +01:00
Eloy Lafuente (stronk7)
57bd925603 MDL-48568 cache: make tests aware of default application store
When an alternative cache configuration is used, aka:

define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true);
$CFG->altcacheconfigpath = '/tmp/xxxxx.php';

the get_expected_application_cache_store() method was not able of
retroffiting the default application store being used.

This commit just implements that functionality so, when
executing unit tests using alternative configuration, assertions
looking for that will pass without a problem.
2014-12-23 01:34:35 +01:00
Sam Hemelryk
63b159d0d4 MDL-48568 cache: stores now determine testing
Cache stores are now responsible for deciding if they are suitable
for use as the primary cache store during unit and acceptance tests

Changes are as follows:
* New method: cache_store::ready_to_be_used_for_testing
* Core cache store have been updated to override this method as
  required.
* MongoDB usesafe default changed to true to match actual default
  behaviour.
2014-12-12 09:30:46 +13:00
Sam Hemelryk
427c41ef2d MDL-45699 cache: renamed cache_config_phpunittest
Renamed cache_config_phpunittest to cache_config_testing
2014-12-09 10:51:38 +13:00
Sam Hemelryk
45a8db7f7b MDL-45699 cache: acceptance test improvements
We now use the unit test cache config class when running
acceptance tests so that the same defines are applicable there.
2014-12-09 10:51:34 +13:00
Sam Hemelryk
c1fb8f6d2e MDL-46151 cachestore_memcache: now checks extension version for support 2014-10-14 08:27:45 +13:00
Sam Hemelryk
c9ef35e1f3 MDL-46208 cachestore_mongo: fixed invalid collection name use 2014-07-04 08:11:27 +12:00
Sam Hemelryk
eefb680d8e MDL-45513 cache: implemented defines for unit testing alternative caches 2014-05-30 08:41:07 +12:00
Sam Hemelryk
79a8ea653c MDL-45513 cache: added support to unit tests for alt cache stores 2014-05-30 08:41:07 +12:00
Eric Merrill
e39099ac36 MDL-45603 cache Fix the mappingsonly option to work as advertised. 2014-05-17 23:48:33 -04:00
Sam Hemelryk
7310a6637a MDL-41997 cache: added unit tests for disabled stores 2013-09-30 09:41:03 +13:00
Sam Hemelryk
b51fed38f2 MDL-40903 cache: renamed loader method to reflect static accelerator 2013-09-25 09:05:18 +12:00
Sam Hemelryk
d074fb091d MDL-40903 cache: renamed persistcache to staticacceleration 2013-09-25 09:05:18 +12:00
Marina Glancy
d67a1a8815 MDL-40903 cache: Unittests and small fixes for persistent application cache 2013-09-25 09:04:36 +12:00
Sam Hemelryk
8bc1d659b8 MDL-40903 cache: coding style tidyup pre-integration 2013-09-25 09:04:35 +12:00
Sam Hemelryk
083fa87759 MDL-40903 cache: converted persistent into persistentdata
At the same time all cache instances were made persistent
2013-09-25 09:04:35 +12:00
Sam Hemelryk
85008bedd5 MDL-41106 cache: several fixes for the session cache.
This issue makes several fixes for the session loader and the session store.
 * maxsize argument now works for session caches.
 * fixed performance hole when interation occurs frequently.
 * fixed cache purge bug occuring when multiple caches are defined before being used.
 * improved lastaccess handling.

Big thanks to Marina who contributed the following commits:
 * Always make sure the elements in cache are sorted so we need to remove only elements in the beginning of array
 * Remove expired elements from session store to free memory
 * Minor bug fixes
2013-08-26 09:15:57 +12:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Damyon Wiese
05b659b252 MDL-40727 Cache: Fix file cache store on windows. 2013-07-24 17:04:44 +08:00
Sam Hemelryk
923f1c420c MDL-40700 cache: fixed cache store unit tests 2013-07-22 10:40:45 +12:00
Eloy Lafuente (stronk7)
3f0a8871d3 Merge branch 'MDL-40555-master' of git://github.com/FMCorz/moodle
Conflicts:
	cache/stores/static/lib.php
2013-07-16 09:57:34 +02:00
Sam Hemelryk
4a749e93b4 MDL-40555 cache: implemented unit tests for default search functionality 2013-07-16 08:29:17 +08:00
Russell Smith
ae21341523 MDL-40538 caching: Use isset for performance
isset is much faster than array_key_exists. For caches we need to
ensure as much performance as possible. To all null to continue to
be stored and provide correct results, non ttl also now saves in
$this->store[$key][0].  As isset($this->store[$key]) will return
true in all cases.

time() as found in cache::now() can be slow on some platforms and
we shouldn't bother checking it unless needed. It also stops non-ttl
caches paying the ttl price.

Unit tests were adjusted to ensure null is still handled correctly
when we are only using isset.
2013-07-10 10:15:19 +10:00
Sam Hemelryk
045fe95c63 MDL-39525 cache: fixed purging definitions requiring identifiers 2013-05-07 15:11:33 +12:00
Sam Hemelryk
5f5776c1e6 MDL-37500 cache: integration review touchups.
Issues:
1. Fix setType calls
2. Changing from default to all and editing again, default is still selected.
3. Uncheck all options causes error.
4. Doesn't seem to be restricting based upon option.
5. Picked all and got coding error with the database thing.
6. Bad title: https://github.com/samhemelryk/moodle/commit/wip-MDL-37500-m25#L1R157
7. Amend comments - should only be removed once 2.5 is the minimum version for an upgrade.
8. Document the defaultsharing option.

Outcomes:
1. Fixed - copy paste error.
2. Fixed - mforms was applying the default value despite a value being provided. A quirk of elements with array names.
3. Fixed - validation now requires at least one option to be selected.
4. Fixed - issue rose from definitions not being re-parsed. cache/admin.php now reparses the first time a user visits the page.
5. Fixed - better purging of definitions when working with them anonymously. Unit test added.
6. Fixed - new string added and used.
7. Fixed - comments amended.

New issue to address parsing of definitions during upgrade.
New issue to add debugging notice if definition sets only one possible sharing option and that option is user input.
2013-05-07 12:49:12 +12:00
Sam Hemelryk
46e17f04c7 MDL-37500 cache: implemented sharing options and gui 2013-05-07 11:57:37 +12:00
Sam Hemelryk
5cba0c4ba3 MDL-38565 cache: tidy up pre-integration 2013-04-19 10:13:36 +12:00
Sam Hemelryk
dbd2ea4e1f MDL-38565 cache: session caches now function as expected
This change is a large change to the way sessions are handled
within MUC after it was discovered that session did not function
as expected when any store other than the default session store
was being used.
As part of this change the session loader has been largely
customised in order to consolidate session data for the loader.
The unit tests have also being greatly increased to provide
better coverage for sessions.
2013-04-19 10:11:48 +12:00
Sam Hemelryk
35b2d0db5e MDL-38303 cache: fixed purging of session cache when switching users 2013-03-10 11:31:26 +13:00
Damyon Wiese
be98769eab Merge branch 'wip-MDL-37903-m25' of git://github.com/samhemelryk/moodle 2013-03-05 13:12:12 +08:00
Eloy Lafuente (stronk7)
caa5bcea00 Merge branch 'wip-MDL-38247-m25' of git://github.com/samhemelryk/moodle 2013-03-05 01:08:23 +01:00
Sam Hemelryk
0323e1ab99 MDL-38165 cache: added unit tests for event purging of persistent caches 2013-03-01 11:38:02 +13:00
Sam Hemelryk
ac6754a679 MDL-38427 cache: implemented unit tests for all core cache stores 2013-03-01 10:11:55 +13:00
Sam Hemelryk
01a3333723 MDL-37903 cache: implemented cacheable_object_array 2013-03-01 10:09:06 +13:00
Eloy Lafuente (stronk7)
c45593c6d8 Merge branch 'wip-MDL-38110-m25' of git://github.com/samhemelryk/moodle 2013-02-26 00:48:22 +01:00
Sam Hemelryk
0bdf592e6e MDL-38110 cache: increased ttl unit test value to avoid timing issues 2013-02-21 09:53:02 +13:00
Sam Hemelryk
e0d9b7c0d4 MDL-37683 cache: siteidentifier is now included in the keys 2013-02-18 08:32:03 +13:00
Sam Hemelryk
956d3544f0 MDL-36363 cache: added unit tests for muliple loaders 2013-01-31 12:16:08 +13:00
Sam Hemelryk
94ef67cf5f MDL-36466 cache: tidy up after review 2012-11-26 08:12:00 +13:00
Sam Hemelryk
3680c61a3c MDL-36466 cache: implemented functionality to disable the bulk of the cache API 2012-11-26 08:12:00 +13:00
Sam Hemelryk
82afd05c35 MDL-36466 cache: renamed disable to disable_stores and added tests 2012-11-26 08:12:00 +13:00
Sam Hemelryk
5dd68a7523 MDL-36407 cache: unit tests + checks + improved string cache 2012-11-16 09:46:49 +13:00
Sam Hemelryk
702651c7a6 MDL-36120 cache: Tidied up post peer-review 2012-11-07 10:03:32 +13:00
Sam Hemelryk
47834bcd41 MDL-36120 cache: now uses sha1 and has an option for simple keys 2012-11-07 10:03:32 +13:00
Sam Hemelryk
e0a568e281 MDL-36094 cache: Fixed up inclusion path for overrideclassfile and datasourcefile 2012-10-19 08:11:40 +08:00
Sam Hemelryk
267ebe02b3 MDL-25290 cache: Fixed issues with references when getting, and added unit tests to cover 2012-10-08 09:53:53 +13:00
Sam Hemelryk
26ce56fddf MDL-25290 cache: renaming to better separate store plugins from lock plugins 2012-10-08 09:53:52 +13:00
Sam Hemelryk
42f2c59eb8 MDL-25290 cache: Added unit tests for admin and fixed up identified issues 2012-10-08 09:53:52 +13:00
Sam Hemelryk
8dbfbd71c9 MDL-25290 cache: Fixed up handling of objects by cache loader 2012-10-08 09:53:52 +13:00