forked from redis/librdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate python json parser as a service for testing (redis#46)
One of the outputs of librdb is JSON. Until now there was a naive testing code that compared two json files, attempting to ignore JSON elements ordering. This commit replaces it with a python service, run in the background, read JSON filename from its STDIN, generates its signature by ignoring JSON elements order, and prints SHA256 signature to its STDOUT. test_common.c will fork this service. The reason it is running as a service is to avoid the overhead of starting a new process for each evaluation and the intensive use of it.
- Loading branch information
Showing
50 changed files
with
580 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
[{ | ||
"__aux__" : { | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1713086666", | ||
"used-mem":"966312", | ||
"aof-base":"0" | ||
},{ | ||
}, | ||
|
||
"__func__": { | ||
"__Function_1":"#!lua name=mylib2\n\nlocal function my_hset2(keys, args)\n local hash = keys[1]\n local time = redis.call('TIME')[1]\n return redis.call('HSET', hash, '_last_modified_', time, unpack(args))\nend\n\nlocal function my_hgetall2(keys, args)\n redis.setresp(3)\n local hash = keys[1]\n local res = redis.call('HGETALL', hash)\n res['map']['_last_modified_'] = nil\n return res\nend\n\nlocal function my_hlastmodified2(keys, args)\n local hash = keys[1]\n return redis.call('HGET', hash, '_last_modified_')\nend\n\nredis.register_function('my_hset2', my_hset2)\nredis.register_function('my_hgetall2', my_hgetall2)\nredis.register_function('my_hlastmodified2', my_hlastmodified2)\n\n", | ||
"__Function_3":"#!lua name=mylib\n\nlocal function my_hset(keys, args)\n local hash = keys[1]\n local time = redis.call('TIME')[1]\n return redis.call('HSET', hash, '_last_modified_', time, unpack(args))\nend\n\nlocal function my_hgetall(keys, args)\n redis.setresp(3)\n local hash = keys[1]\n local res = redis.call('HGETALL', hash)\n res['map']['_last_modified_'] = nil\n return res\nend\n\nlocal function my_hlastmodified(keys, args)\n local hash = keys[1]\n return redis.call('HGET', hash, '_last_modified_')\nend\n\nredis.register_function('my_hset', my_hset)\nredis.register_function('my_hgetall', my_hgetall)\nredis.register_function('my_hlastmodified', my_hlastmodified)\n\n" | ||
}, | ||
{ | ||
"key_97":"value_97", | ||
"key_90":"value_90", | ||
"key_93":"value_93", | ||
"key_99":"value_99", | ||
"key_96":"value_96", | ||
"key_92":"value_92", | ||
"key_95":"value_95", | ||
"key_91":"value_91", | ||
"key_94":"value_94", | ||
"key_98":"value_98" | ||
}] | ||
|
||
"key_97":"value_97", | ||
"key_90":"value_90", | ||
"key_93":"value_93", | ||
"key_99":"value_99", | ||
"key_96":"value_96", | ||
"key_92":"value_92", | ||
"key_95":"value_95", | ||
"key_91":"value_91", | ||
"key_94":"value_94", | ||
"key_98":"value_98" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0", | ||
"__aux__" : { | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0" | ||
}, | ||
|
||
"hash2":{"field7":"value7","field8":"value8","9":"value9","field10":"value10","field11":"11","12":"12.0"}, | ||
"hash1":{"field2":"2","field3":"3","field4":"value4.0","field5":"5.0","6":"6"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0", | ||
"__aux__" : { | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0" | ||
}, | ||
|
||
"hash2":"\u0010\u00c3@C@V\u0013V\u0000\u0000\u0000\f\u0000\u0086field7\u0007\u0086value \u0007`\u000f\u00008\u00a0\u000f\u00038\u0007\t\u0001\u0080\u0019\u00029\u0007\u0087`\u0019\u000310\b\u0087`*@\b\u0080\u0011\f1\b\u000b\u0001\f\u0001\u008412.0\u0005\u00ff", | ||
"hash1":"\u0010\u00c35>\u000f>\u0000\u0000\u0000\n\u0000\u0086field2\u0007\u0002\u0001\u0080\t\u00023\u0007\u0003\u00a0\t\u000b4\u0007\u0088value4.0\t\u0080\u001b\u000b5\u0007\u00835.0\u0004\u0006\u0001\u0006\u0001\u00ff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0", | ||
"__aux__" : { | ||
"redis-ver":"255.255.255", | ||
"redis-bits":"64", | ||
"ctime":"1695280472", | ||
"used-mem":"1062024", | ||
"aof-base":"0" | ||
}, | ||
|
||
"hash2":["V\u0000\u0000\u0000\f\u0000\u0086field7\u0007\u0086value7\u0007\u0086field8\u0007\u0086value8\u0007\t\u0001\u0086value9\u0007\u0087field10\b\u0087value10\b\u0087field11\b\u000b\u0001\f\u0001\u008412.0\u0005\u00ff"], | ||
"hash1":[">\u0000\u0000\u0000\n\u0000\u0086field2\u0007\u0002\u0001\u0086field3\u0007\u0003\u0001\u0086field4\u0007\u0088value4.0\t\u0086field5\u0007\u00835.0\u0004\u0006\u0001\u0006\u0001\u00ff"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0", | ||
"__aux__" : { | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0" | ||
}, | ||
|
||
"myhash":{"1":"2","3":"4","5":"6","7.0":"8.0","str1":"str2","str3":"str4"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0", | ||
"__aux__" : { | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0" | ||
}, | ||
|
||
"myhash":"\r99\u0000\u0000\u00002\u0000\u0000\u0000\f\u0000\u0000\u00f2\u0002\u00f3\u0002\u00f4\u0002\u00f5\u0002\u00f6\u0002\u00f7\u0002\u00037.0\u0005\u00038.0\u0005\u0004str1\u0006\u0004str2\u0006\u0004str3\u0006\u0004str4\u00ff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0", | ||
"__aux__" : { | ||
"redis-ver":"6.0.16", | ||
"redis-bits":"64", | ||
"ctime":"1690533464", | ||
"used-mem":"865216", | ||
"aof-preamble":"0" | ||
}, | ||
|
||
"myhash":["9\u0000\u0000\u00002\u0000\u0000\u0000\f\u0000\u0000\u00f2\u0002\u00f3\u0002\u00f4\u0002\u00f5\u0002\u00f6\u0002\u00f7\u0002\u00037.0\u0005\u00038.0\u0005\u0004str1\u0006\u0004str2\u0006\u0004str3\u0006\u0004str4\u00ff"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
"redis-ver":"3.2.1", | ||
"redis-bits":"64", | ||
"ctime":"1689605183", | ||
"used-mem":"821904", | ||
"__aux__" : { | ||
"redis-ver":"3.2.1", | ||
"redis-bits":"64", | ||
"ctime":"1689605183", | ||
"used-mem":"821904" | ||
}, | ||
|
||
"myhash1":{"5":"5","6":"6","10":"10","1":"1","2":"2","8":"8","4":"4","9":"9","3":"3","7":"7","11":"11"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
"redis-ver":"3.2.1", | ||
"redis-bits":"64", | ||
"ctime":"1689605183", | ||
"used-mem":"821904", | ||
"__aux__" : { | ||
"redis-ver": "3.2.1", | ||
"redis-bits": "64", | ||
"ctime": "1689605183", | ||
"used-mem": "821904" | ||
}, | ||
|
||
"myhash1":"\u0004\u000b\u00c0\u0005\u00c0\u0005\u00c0\u0006\u00c0\u0006\u00c0\n\u00c0\n\u00c0\u0001\u00c0\u0001\u00c0\u0002\u00c0\u0002\u00c0\b\u00c0\b\u00c0\u0004\u00c0\u0004\u00c0\t\u00c0\t\u00c0\u0003\u00c0\u0003\u00c0\u0007\u00c0\u0007\u00c0\u000b\u00c0\u000b" |
Oops, something went wrong.