Add a check for proper running of memcache for testing purposes (don't
use this function on prod servers as it is bogus info)
Patch by kareila.
diffs (32 lines):
diff -r 8a65ea36289a -r ad0b62e5fb31 cgi-bin/LJ/Test.pm
--- a/cgi-bin/LJ/Test.pm Thu Apr 28 11:28:58 2011 +0800
+++ b/cgi-bin/LJ/Test.pm Thu Apr 28 11:31:20 2011 +0800
@@ -168,6 +168,15 @@ sub memcache_stress (&) {
# restore our memcache client object from before.
LJ::MemCache::set_memcache($pre_mem);
+}
+
+# this is a quick check for whether memcache is functioning correctly
+# using a bogus wsse_auth key - add fails when not working as configured
+sub check_memcache {
+ return 1 unless @LJ::MEMCACHE_SERVERS; # OK if not set
+
+ my $secs = time;
+ return LJ::MemCache::add( "wsse_auth:xxx:$secs", 1, 1 );
}
sub routing_request {
diff -r 8a65ea36289a -r ad0b62e5fb31 t/atom-post.t
--- a/t/atom-post.t Thu Apr 28 11:28:58 2011 +0800
+++ b/t/atom-post.t Thu Apr 28 11:31:20 2011 +0800
@@ -6,6 +6,9 @@ use lib "$ENV{LJHOME}/cgi-bin";
use lib "$ENV{LJHOME}/cgi-bin";
require 'ljlib.pl';
use LJ::Test;
+
+plan skip_all => "Memcache configured but not active."
+ unless LJ::Test::check_memcache;
use XML::Atom::Client;
use XML::Atom::Entry;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog