Skip to content

Commit d16841d

Browse files
authored
More unit tests unskipped for windows (#3078)
fix for non-failing CI builds when ovms_test building fails After this change we have only those skips: custom loader (deprecated) sporadics which will be fixed in other tasks embeddings tests which require custom extension
1 parent c0b313e commit d16841d

7 files changed

+25
-35
lines changed

src/test/ensemble_flow_custom_node_tests.cpp

+4-19
Original file line numberDiff line numberDiff line change
@@ -1495,13 +1495,7 @@ class EnsembleFlowCustomNodeLoadConfigThenExecuteTest : public EnsembleFlowCusto
14951495
}
14961496

14971497
void loadConfiguration(const char* configContent, Status expectedStatus = StatusCode::OK) {
1498-
std::string ovmsConfig = std::string(configContent);
1499-
1500-
std::string newDir = getGenericFullPathForBazelOut("/ovms/bazel-bin/src");
1501-
std::regex regexPattern(R"(/ovms/bazel-bin/src)");
1502-
ovmsConfig = std::regex_replace(ovmsConfig, regexPattern, newDir);
1503-
1504-
createConfigFileWithContent(ovmsConfig, configJsonFilePath);
1498+
createConfigFileWithContent(adjustConfigForTargetPlatformCStr(configContent), configJsonFilePath);
15051499
ASSERT_EQ(manager.loadConfig(configJsonFilePath), expectedStatus);
15061500
}
15071501

@@ -1819,9 +1813,6 @@ static const char* pipelineCustomNodeDifferentOperationsConfig = R"(
18191813
class EnsembleFlowCustomNodeAndDemultiplexerLoadConfigThenExecuteTest : public EnsembleFlowCustomNodeLoadConfigThenExecuteTest {
18201814
protected:
18211815
void SetUp() override {
1822-
#ifdef _WIN32
1823-
GTEST_SKIP() << "Test disabled on windows";
1824-
#endif
18251816
EnsembleFlowCustomNodeLoadConfigThenExecuteTest::SetUp();
18261817
configJsonFilePath = directoryPath + "/ovms_config_file.json";
18271818
}
@@ -2457,13 +2448,13 @@ struct LibraryParamControlledMetadata {
24572448
const char* end = str;
24582449
for (; *end != '\0'; ++end) {
24592450
if ((end - str) > MAX) {
2460-
EXPECT_TRUE(false);
2451+
EXPECT_TRUE(false) << *end;
24612452
}
24622453
}
24632454
const char* end2 = prefix;
24642455
for (; *end2 != '\0'; ++end2) {
2465-
if ((end2 - str) > MAX) {
2466-
EXPECT_TRUE(false);
2456+
if ((end2 - prefix) > MAX) {
2457+
EXPECT_TRUE(false) << *end2;
24672458
}
24682459
}
24692460
size_t strLen = std::strlen(str);
@@ -2552,9 +2543,6 @@ struct LibraryParamControlledMetadata {
25522543
class EnsembleConfigurationValidationWithCustomNode : public ::testing::Test {
25532544
protected:
25542545
void SetUp() override {
2555-
#ifdef _WIN32
2556-
GTEST_SKIP() << "Test disabled on windows";
2557-
#endif
25582546
mockedLibrary = createLibraryMock<LibraryParamControlledMetadata>();
25592547
ASSERT_TRUE(mockedLibrary.isValid());
25602548
}
@@ -4408,9 +4396,6 @@ TEST_F(EnsembleConfigurationValidationWithDemultiplexer, DemultiplexerWithoutGat
44084396
class EnsembleFlowCustomNodeAndDynamicDemultiplexerLoadConfigThenExecuteTest : public EnsembleFlowCustomNodeLoadConfigThenExecuteTest {
44094397
protected:
44104398
void SetUp() override {
4411-
#ifdef _WIN32
4412-
GTEST_SKIP() << "Test disabled on windows";
4413-
#endif
44144399
EnsembleFlowCustomNodeLoadConfigThenExecuteTest::SetUp();
44154400
configJsonFilePath = directoryPath + "/ovms_config_file.json";
44164401
}

src/test/gather_node_test.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,11 @@ class DLNodeWithGetInputsExposed : public DLNode {
219219
};
220220

221221
TEST_F(GatherNodeTest, FullFlowGatherInNonExitNode) {
222-
#ifdef _WIN32
223-
GTEST_SKIP() << "Test disabled on windows";
224-
#endif
225222
// This test simulates node with multiple subsessions connected to following node
226223
// that should gather it results but is not exit node
227224
ConstructorEnabledModelManager manager;
228225
const std::string fileToReload = directoryPath + "/ovms_config_file.json";
229-
createConfigFileWithContent(configDummy1BsDummy2Bs, fileToReload);
226+
createConfigFileWithContent(adjustConfigForTargetPlatformCStr(configDummy1BsDummy2Bs), fileToReload);
230227
auto status = manager.loadConfig(fileToReload);
231228
ASSERT_EQ(status, StatusCode::OK) << status.string();
232229
const std::string node1Name = "node1";

src/test/mediapipe/config_mediapipe_two_outputs_dag.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"custom_node_library_config_list": [
44
{
55
"name": "lib_perform_different_operations",
6-
"base_path": "/ovms/bazel-bin/src/lib_node_perform_different_operations.so"
6+
"base_path": "/ovms/bazel-bin//src/lib_node_perform_different_operations.so"
77
}
88
],
99
"pipeline_config_list": [

src/test/mediapipeflow_test.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,6 @@ class MediapipeFlowTwoOutputsDagTest : public MediapipeFlowTest {
917917
};
918918

919919
TEST_F(MediapipeFlowTwoOutputsDagTest, Infer) {
920-
#ifdef _WIN32
921-
GTEST_SKIP() << "Test disabled on windows - Custom Nodes for windows are unsupported";
922-
#endif
923920
std::vector<float> input{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
924921
std::vector<float> factors{1, 3, 2, 2};
925922

src/test/model_service_test.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,8 @@ static const char* pipelineOneDummyConfig = R"(
163163
})";
164164

165165
TYPED_TEST(ModelServiceTest, pipeline) {
166-
#ifdef _WIN32
167-
GTEST_SKIP() << "Test disabled on windows";
168-
#endif
169166
std::string fileToReload = getGenericFullPathForTmp("/tmp/ovms_single_version_pipeline.json");
170-
createConfigFileWithContent(pipelineOneDummyConfig, fileToReload);
167+
createConfigFileWithContent(adjustConfigForTargetPlatformCStr(pipelineOneDummyConfig), fileToReload);
171168
ASSERT_EQ(this->manager.startFromFile(fileToReload), StatusCode::OK);
172169

173170
const std::string name = "dummyPipeline";

windows_change_test_configs.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,35 @@ def main():
3636
replace_back = True
3737
start_dir = os.path.dirname(os.path.realpath(__file__)) + "\\src\\test\\"
3838
windows_path = start_dir
39+
windows_bazel_bin_path = os.path.dirname(os.path.realpath(__file__)) + "\\bazel-bin\\"
3940
print('Setting cwd\\src\\test start search dir: ' + start_dir)
4041
elif len(sys.argv) == 1:
4142
start_dir = os.path.dirname(os.path.realpath(__file__)) + "\\src\\test\\"
4243
windows_path = start_dir
44+
windows_bazel_bin_path = os.path.dirname(os.path.realpath(__file__)) + "\\bazel-bin\\"
4345
print('Setting cwd\\src\\test start search dir: ' + start_dir)
4446
else:
4547
print("[ERROR] Wrong number of parameters.")
4648
exit()
4749

4850
linux_path = "/ovms/src/test/"
51+
linux_path_bazel_bin = "/ovms/bazel-bin/"
4952

5053
print("Replacing back set to: " + str(replace_back))
5154

5255
# Change c:\something\else to c:\\something\\else for json parser compatybility
5356
windows_path = windows_path.replace("\\","\\\\")
57+
windows_bazel_bin_path = windows_bazel_bin_path.replace("\\","\\\\")
5458
if replace_back:
5559
tmp_path = windows_path
5660
windows_path = linux_path
5761
linux_path = tmp_path
62+
tmp_path = windows_bazel_bin_path
63+
windows_bazel_bin_path = linux_path_bazel_bin
64+
linux_path_bazel_bin = tmp_path
5865

59-
print("Replace string: {} with: {} ".format(linux_path, windows_path))
66+
print("Replace string: {} with: {} \nand\n {} with {}".format(
67+
linux_path, windows_path, linux_path_bazel_bin, windows_bazel_bin_path))
6068

6169
extension = '.json' # replace with your desired extension
6270
files_with_extension = []
@@ -79,6 +87,7 @@ def main():
7987
for file in files_with_extension:
8088
try:
8189
replace_string_in_file(file, linux_path, windows_path)
90+
replace_string_in_file(file, linux_path_bazel_bin, windows_bazel_bin_path)
8291
except Exception as e:
8392
print(f"Error parsing file {file}: {e} - changes were not applied")
8493

windows_test.bat

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set "bazelStartupCmd=--output_user_root=!BAZEL_SHORT_PATH!"
2929
set "openvino_dir=!BAZEL_SHORT_PATH!/openvino/runtime/cmake"
3030

3131
set "bazelBuildArgs=--config=windows --action_env OpenVINO_DIR=%openvino_dir%"
32-
set "buildTestCommand=bazel %bazelStartupCmd% build %bazelBuildArgs% --jobs=%NUMBER_OF_PROCESSORS% --verbose_failures //src:ovms_test 2>&1 | tee win_build_test.log"
32+
set "buildTestCommand=bazel %bazelStartupCmd% build %bazelBuildArgs% --jobs=%NUMBER_OF_PROCESSORS% --verbose_failures //src:ovms_test"
3333
set "changeConfigsCmd=python windows_change_test_configs.py"
3434
set "runTest=%cd%\bazel-bin\src\ovms_test.exe --gtest_filter=* 2>&1 > win_full_test.log"
3535

@@ -78,8 +78,13 @@ if !errorlevel! neq 0 exit /b !errorlevel!
7878
if !errorlevel! neq 0 exit /b !errorlevel!
7979

8080
:: Start bazel build test
81-
%buildTestCommand%
82-
if !errorlevel! neq 0 exit /b !errorlevel!
81+
%buildTestCommand% > win_build_test.log 2>&1
82+
set "bazelExitCode=!errorlevel!"
83+
:: Output the log to the console
84+
type win_build_test.log
85+
:: Check the exit code and exit if it's not 0
86+
if !bazelExitCode! neq 0 exit /b !bazelExitCode!
87+
8388

8489
:: Change tests configs to windows paths
8590
%changeConfigsCmd%

0 commit comments

Comments
 (0)