Skip to content

Commit

Permalink
Aligned reporting with latest implemenration (#21503)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrivor authored Dec 7, 2023
1 parent b29a08d commit c61de14
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void RegisterTestCustomQueries(void) {
std::map<std::string, std::string>& extTestQueries = *::PostgreSQLLink::get_ext_test_queries();
std::map<std::string, std::string>& extTestNames = *::PostgreSQLLink::get_ext_test_names();

std::string testName("checkPluginImplementationCompileModel");
std::string testName("checkPluginImplementation");
extTestQueries[testName + "_ON_START"] =
"OpImplCheck_CheckPluginImpl($__test_id, '$opName', '$opSet', "
"'$targetDevice', '$targetDeviceArch', '$targetDeviceName', '$config', $__is_temp)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ get_model_paths(const std::vector<std::string>& conformance_ir_paths,
//Save it in a list, first value - path, second - amout of tests with this path
for (auto& val : tmp_buf) {
bool is_op = false;
#ifdef _WIN32
for (auto it = val.begin(); it != val.end(); ++it) {
if (*it == '/')
val.replace(it, it + 1, ov::test::utils::FileSeparator);
}
#endif
for (const auto& path_item : ov::test::utils::splitStringByDelimiter(val, ov::test::utils::FileSeparator)) {
auto tmp_path_item = path_item;
auto pos = tmp_path_item.find('-');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ std::string ReadIRTest::getTestCaseName(const testing::TestParamInfo<ReadIRParam
op_version = op_name.substr(pos + 1);
op_name = op_name.substr(0, pos);
}
if (std::find(unique_ops[op_name].begin(),
unique_ops[op_name].end(), op_version) != unique_ops[op_name].end() &&
unique_ops.find(op_name) != unique_ops.end()) {
if (unique_ops.find(op_name) != unique_ops.end() &&
std::find(unique_ops[op_name].begin(), unique_ops[op_name].end(), op_version) !=
unique_ops[op_name].end()) {
filled_info["op_name"] = op_name + "." + op_version;
continue;
}
Expand Down Expand Up @@ -192,20 +192,23 @@ void ReadIRTest::SetUp() {
// Try to resolve missing info
if (splittedFilename.size() > 2) {
auto pos = splittedFilename[2].find('-');
std::string op_name = "", op_version = "opset";
std::string op_name = "", op_version = "";
if (pos != std::string::npos) {
op_name = splittedFilename[2].substr(0, pos);
op_version += splittedFilename[2].substr(pos + 1);
if (ov::test::op_conformance::unique_ops.find(op_name) != ov::test::op_conformance::unique_ops.end() &&
std::find(ov::test::op_conformance::unique_ops[op_name].begin(),
ov::test::op_conformance::unique_ops[op_name].end(),
op_version) != ov::test::op_conformance::unique_ops[op_name].end()) {
op_version = splittedFilename[2].substr(pos + 1);
if (unique_ops.find(op_name) != unique_ops.end() &&
std::find(unique_ops[op_name].begin(),
unique_ops[op_name].end(),
op_version) != unique_ops[op_name].end()) {
pgLink->set_custom_field("opName", op_name, true);
pgLink->set_custom_field("opSet", op_version, true);
}
} else if (splittedFilename.size() > 3 && splittedFilename[3] == "subgraph") {
pgLink->set_custom_field("opName", splittedFilename[1], true);
pgLink->set_custom_field("opSet", "subgraph", true);
} else {
for (const auto& path_part : splittedFilename) {
if (ov::test::op_conformance::unique_ops.find(path_part) != ov::test::op_conformance::unique_ops.end()) {
if (unique_ops.find(path_part) != unique_ops.end()) {
op_name = path_part;
break;
}
Expand Down
16 changes: 14 additions & 2 deletions src/tests/test_utils/common_test_utils/src/postgres_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,22 @@ void add_pair(std::map<std::string, std::string>& keyValues, const std::string&
keyValues["opSet"] = value.substr(dPos + 1);
}
}
// Defining a subgraph extractors as an operations
if (key == "Extractor") {
keyValues["opName"] = value;
keyValues["opSet"] = "subgraph"; // Need to set later
}
// Parse IR for opName and hash
if (key == "IR") {
keyValues["hashXml"] = value;
keyValues["pathXml"] = value + ".xml";
if ((dPos = value.find_last_of('/')) != std::string::npos ||
(dPos = value.find_last_of('\\')) != std::string::npos) {
dPos += 1; // Ignores slash
keyValues["hashXml"] = value.substr(dPos, value.length() - dPos - 4); // exclude extension
keyValues["pathXml"] = value.substr(dPos);
} else {
keyValues["hashXml"] = value;
keyValues["pathXml"] = value + ".xml";
}
return;
}
// Parse Function for opName and opSet
Expand Down

0 comments on commit c61de14

Please sign in to comment.