mirror of
https://github.com/dragonflydb/dragonfly
synced 2024-11-21 15:11:20 +00:00
fix(json_family): Fix error in JsonFamilyTest.MGet (#3285)
* fix(json_family): Fix error in JsonFamilyTest.MGet Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): address comments Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): Change LOG(WARNING) to VLOG(2) Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * fix(json_family): Test case when jsonpathv2 is false Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): Update VLOGs level from 2 to 1 Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> --------- Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>
This commit is contained in:
parent
628985bed2
commit
e914a5f7cf
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -156,6 +156,7 @@ jobs:
|
||||
./dragonfly_test
|
||||
./multi_test --multi_exec_mode=1
|
||||
./multi_test --multi_exec_mode=3
|
||||
./json_family_test --jsonpathv2=false
|
||||
|
||||
- name: Upload unit logs on failure
|
||||
if: failure()
|
||||
|
@ -1447,10 +1447,16 @@ io::Result<JsonPathV2, string> ParsePathV2(string_view path) {
|
||||
}
|
||||
|
||||
if (absl::GetFlag(FLAGS_jsonpathv2)) {
|
||||
return json::ParsePath(path);
|
||||
auto path_result = json::ParsePath(path);
|
||||
if (!path_result) {
|
||||
VLOG(1) << "Invalid Json path: " << path << ' ' << path_result.error() << std::endl;
|
||||
return nonstd::make_unexpected(kSyntaxErr);
|
||||
}
|
||||
return path_result;
|
||||
}
|
||||
io::Result<JsonExpression> expr_result = ParseJsonPath(path);
|
||||
if (!expr_result) {
|
||||
VLOG(1) << "Invalid Json path: " << path << ' ' << expr_result.error() << std::endl;
|
||||
return nonstd::make_unexpected(kSyntaxErr);
|
||||
}
|
||||
return JsonPathV2(std::move(expr_result.value()));
|
||||
|
@ -982,7 +982,7 @@ TEST_F(JsonFamilyTest, MGet) {
|
||||
|
||||
#ifndef SANITIZERS
|
||||
resp = Run({"JSON.MGET", "json1", "??INNNNVALID??"});
|
||||
EXPECT_THAT(resp, ErrArg("Unknown token"));
|
||||
EXPECT_THAT(resp, ErrArg("ERR syntax error"));
|
||||
#endif
|
||||
|
||||
resp = Run({"JSON.MGET", "json1", "json2", "json3", "$.address.country"});
|
||||
|
Loading…
Reference in New Issue
Block a user