[wp-trac] [WordPress Trac] #31491: Enhance unit tests for persistent object caching

WordPress Trac noreply at wordpress.org
Sat Feb 28 12:41:55 UTC 2015


#31491: Enhance unit tests for persistent object caching
------------------------------+-----------------------------
 Reporter:  ocean90           |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:                    |
------------------------------+-----------------------------
 While running the tests with an object-cache.php drop-in (in this case
 [http://wordpress.org/extend/plugins/memcached/ Memcached]) I got some
 failing tests:

 {{{
 There were 6 failures:

 1) Tests_Cache::test_wp_cache_init
 Failed asserting that two objects are equal.
 --- Expected
 +++ Actual
 @@ @@
          'default' => Memcache Object (
 -            'connection' => resource(671) of type (memcache connection)
 +            'connection' => resource(670) of type (memcache connection)
              '_failureCallback' => Array (...)
          )
      )
      'stats' => Array (...)
      'group_ops' => Array ()
      'cache_enabled' => true
      'default_expiration' => 0
      'global_prefix' => 'wptests_'
      'blog_prefix' => 'wptests_:'
      'cache_hits' => null
      'cache_misses' => null
  )

 /srv/www/wp-develop/svn/tests/phpunit/tests/cache.php:284

 2) Tests_Import_Import::test_small_import
 Failed asserting that 0 matches expected 6.

 /srv/www/wp-develop/svn/tests/phpunit/tests/import/import.php:170

 3) Tests_Option_SiteTransient::test_the_basics
 Failed asserting that true is false.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/siteTransient.php:16

 4) Tests_Option_Transient::test_the_basics
 Failed asserting that true is false.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:16

 5) Tests_Option_Transient::test_transient_data_with_timeout
 Failed asserting that false is equal to 1425119322 or is greater than
 1425119322.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:54

 6) Tests_Option_Transient::test_transient_add_timeout
 Failed asserting that false is equal to 1425119222 or is greater than
 1425119222.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:81

 FAILURES!
 Tests: 3183, Assertions: 12576, Failures: 6, Skipped: 3.
 }}}


 We should enhance these tests to make them work with a persistent object
 cache.

 From @pento: "It'd be worth having a memcache variant of our Travis
 tests.". Sounds like a good idea to me.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31491>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list