Skip to content

Commit

Permalink
make redis keys unique so parallel test cases nit interfere with each…
Browse files Browse the repository at this point in the history
… other
  • Loading branch information
michaeloffner committed Jan 18, 2024
1 parent 4a50968 commit 73106b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tests/RedisCommandTypes.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
describe("My Redis Extension Tests", function() {

it("can increment Redis key value using Float", function() {
keyName = "test:float";
keyName = "test:float"&hash(createUniqueId()&":"&server.lucee.version,"quick");
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName);
var Float = createObject("java", "java.lang.Float");
var f = Float.parseFloat("100");
Expand All @@ -58,7 +58,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it("can increment Redis key value using Double", function() {
keyName = "test:double";
keyName = "test:double"&hash(createUniqueId()&":"&server.lucee.version,"quick");
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName);
var Double = createObject("java", "java.lang.Double");
var d = Double.parseDouble("100");
Expand All @@ -68,7 +68,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it("can increment Redis key value using Short", function() {
keyName = "test:short";
keyName = "test:short"&hash(createUniqueId()&":"&server.lucee.version,"quick");
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName);
var Short = createObject("java", "java.lang.Short");
var s = Short.parseShort("100");
Expand All @@ -78,7 +78,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it("can increment Redis key value using Integer", function() {
keyName = "test:int";
keyName = "test:int"&hash(createUniqueId()&":"&server.lucee.version,"quick");
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName);
var Integer = createObject("java", "java.lang.Integer");
var i = Integer.parseInt("100");
Expand All @@ -88,7 +88,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it("can increment Redis key value using Long", function() {
keyName = "test:long";
keyName = "test:long"&hash(createUniqueId()&":"&server.lucee.version,"quick");
redisCommand(arguments: ["SET", keyName, initialValue], cache: cacheName);
var Long = createObject("java", "java.lang.Long");
var l = Long.parseLong("100");
Expand Down
8 changes: 4 additions & 4 deletions tests/RedisTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
describe( "Redis tests", function() {

it( title='test the Redis Cache cachePut,cacheidexists,cacheGet,cacheDelete [queryBuffer] ', body=function( currentSpec ) {
var key="k"&createUniqueId();
var key="k"&hash(createUniqueId()&":"&server.lucee.version,"quick");
var val="Test Value from Test case";
try {
cachePut(key:key,value:val,cacheName:"querybuffer");
Expand All @@ -132,7 +132,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it( title='test the Redis Cache cachePut,cacheidexists,cacheGetAll,cacheGetAllIds,cacheDelete [queryBuffer] ', body=function( currentSpec ) {
var key="k"&createUniqueId();
var key="k"&hash(createUniqueId()&":"&server.lucee.version,"quick");
var val="Test Value from Test case";

cachePut(key:key,value:val,cacheName:"querybuffer");
Expand All @@ -147,7 +147,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it( title='test the Redis Cache cachePut,cacheidexists,cacheGet,cacheDelete [queues] ', body=function( currentSpec ) {
var key="k"&createUniqueId();
var key="k"&hash(createUniqueId()&":"&server.lucee.version,"quick");
var val="Test Value from Test case";
try {
cachePut(key:key,value:val,cacheName:"queues");
Expand All @@ -165,7 +165,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="redis" {
});

it( title='test the Redis Cache cachePut,cacheidexists,cacheGet,cacheDelete [sessionstorage] ', body=function( currentSpec ) {
var key="k"&createUniqueId();
var key="k"&hash(createUniqueId()&":"&server.lucee.version,"quick");
var val="Test Value from Test case";
try {
cachePut(key:key,value:val,cacheName:"sessionstorage");
Expand Down

0 comments on commit 73106b0

Please sign in to comment.