diff options
Diffstat (limited to 'searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp index 31557f13a54..c46990732b7 100644 --- a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp +++ b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp @@ -71,7 +71,6 @@ struct Setup { std::map<std::string,std::string> properties; std::map<std::string,std::string> constants; std::vector<bool> extra_profiles; - std::map<std::string,std::string> ranking_expressions; std::map<std::string,OnnxModel> onnx_models; Setup(); ~Setup(); @@ -97,9 +96,6 @@ struct Setup { void rank_expr(const std::string &name, const std::string &expr) { property(fmt("rankingExpression(%s).rankingScript", name.c_str()), expr); } - void ext_rank_expr(const std::string &name, const std::string &file) { - ranking_expressions.insert_or_assign(name, TEST_PATH(file)); - } void first_phase(const std::string &feature) { property(rank::FirstPhase::NAME, feature); } @@ -161,14 +157,6 @@ struct Setup { ++idx; } } - void write_ranking_expressions(const Writer &out) { - size_t idx = 0; - for (const auto &entry: ranking_expressions) { - out.fmt("expression[%zu].name \"%s\"\n", idx, entry.first.c_str()); - out.fmt("expression[%zu].fileref \"expr_ref_%zu\"\n", idx, idx); - ++idx; - } - } void write_onnx_models(const Writer &out) { size_t idx = 0; for (const auto &entry: onnx_models) { @@ -191,12 +179,6 @@ struct Setup { } void write_self_cfg(const Writer &out) { size_t idx = 0; - for (const auto &entry: ranking_expressions) { - out.fmt("file[%zu].ref \"expr_ref_%zu\"\n", idx, idx); - out.fmt("file[%zu].path \"%s\"\n", idx, entry.second.c_str()); - ++idx; - } - idx = 0; for (const auto &entry: onnx_models) { out.fmt("file[%zu].ref \"onnx_ref_%zu\"\n", idx, idx); out.fmt("file[%zu].path \"%s\"\n", idx, entry.second.file_path().c_str()); @@ -208,7 +190,6 @@ struct Setup { write_indexschema(Writer(gen_dir + "/indexschema.cfg")); write_rank_profiles(Writer(gen_dir + "/rank-profiles.cfg")); write_ranking_constants(Writer(gen_dir + "/ranking-constants.cfg")); - write_ranking_expressions(Writer(gen_dir + "/ranking-expressions.cfg")); write_onnx_models(Writer(gen_dir + "/onnx-models.cfg")); write_self_cfg(Writer(gen_dir + "/verify-ranksetup.cfg")); } @@ -377,23 +358,6 @@ TEST_F("require that imported attribute field can be used by rank feature", Simp //----------------------------------------------------------------------------- -TEST_F("require that external ranking expression can be verified", SimpleSetup()) { - f.ext_rank_expr("my_expr", "good_ranking_expression"); - f.verify_valid({"rankingExpression(my_expr)"}); -} - -TEST_F("require that external ranking expression can fail verification", SimpleSetup()) { - f.ext_rank_expr("my_expr", "bad_ranking_expression"); - f.verify_invalid({"rankingExpression(my_expr)"}); -} - -TEST_F("require that missing expression file fails verification", SimpleSetup()) { - f.ext_rank_expr("my_expr", "missing_ranking_expression_file"); - f.verify_invalid({"rankingExpression(my_expr)"}); -} - -//----------------------------------------------------------------------------- - TEST_F("require that onnx model can be verified", OnnxSetup()) { f.rank_expr("query_tensor", "tensor<float>(a[1],b[4]):[[1,2,3,4]]"); f.rank_expr("attribute_tensor", "tensor<float>(a[4],b[1]):[[5],[6],[7],[8]]"); |