[apiConformance] Fix relative all (#16518)

This commit is contained in:
Sofya Balandina 2023-04-06 17:24:13 +01:00 committed by GitHub
parent 5f416dc4d2
commit 5ccc743707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public:
void SetUp() override { void SetUp() override {
set_api_entity(); set_api_entity();
auto test_name = this->GetTestName(); auto test_name = this->GetFullTestName();
k = test_name.find("_mandatory") != std::string::npos || test_name.find("mandatory_") != std::string::npos ? 1 : 0; k = test_name.find("_mandatory") != std::string::npos || test_name.find("mandatory_") != std::string::npos ? 1 : 0;
std::cout << "[ CONFORMANCE ] Influence coefficient: " << k << std::endl; std::cout << "[ CONFORMANCE ] Influence coefficient: " << k << std::endl;
api_summary.updateStat(api_entity, target_device, ov::test::utils::PassRate::Statuses::CRASHED, k); api_summary.updateStat(api_entity, target_device, ov::test::utils::PassRate::Statuses::CRASHED, k);

View File

@ -83,4 +83,15 @@ std::string TestsCommon::GetTestName() const {
return test_name; return test_name;
} }
std::string TestsCommon::GetFullTestName() const {
std::string suite_name =
::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name();
std::replace_if(suite_name.begin(), suite_name.end(),
[](char c) { return !std::isalnum(c); }, '_');
std::string test_name = GetTestName();
return suite_name + "_" + test_name;
}
} // namespace CommonTestUtils } // namespace CommonTestUtils

View File

@ -18,6 +18,7 @@ protected:
static std::string GetTimestamp(); static std::string GetTimestamp();
std::string GetTestName() const; std::string GetTestName() const;
std::string GetFullTestName() const;
}; };
} // namespace CommonTestUtils } // namespace CommonTestUtils

View File

@ -69,12 +69,13 @@ void ApiSummary::updateStat(ov_entity entity, const std::string& target_device,
if (isCrashReported) { if (isCrashReported) {
cur_stat[real_device].crashed--; cur_stat[real_device].crashed--;
isCrashReported = false; isCrashReported = false;
} else {
cur_stat[real_device].rel_all += rel_influence_coef;
} }
if (isHangReported) { if (isHangReported) {
isHangReported = false; isHangReported = false;
return; return;
} }
cur_stat[real_device].rel_all += rel_influence_coef;
switch (status) { switch (status) {
case PassRate::Statuses::SKIPPED: { case PassRate::Statuses::SKIPPED: {
cur_stat[real_device].skipped++; cur_stat[real_device].skipped++;