Skip to content

Commit

Permalink
Improve automated (nightly vs manual) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosbento authored Nov 28, 2023
2 parents c00afce + d990193 commit 1c75073
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 23 deletions.
3 changes: 2 additions & 1 deletion ACore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ ecbuild_add_test(
TARGET
u_acore
LABELS
unit nightly
unit
nightly
SOURCES
${test_srcs}
LIBS
Expand Down
3 changes: 2 additions & 1 deletion ANattr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ ecbuild_add_test(
TARGET
u_anattr
LABELS
unit nightly
unit
nightly
SOURCES
${test_srcs}
LIBS
Expand Down
20 changes: 13 additions & 7 deletions ANode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ ecbuild_add_test(
TARGET
u_anode
LABELS
unit nightly
unit
nightly
SOURCES
${test_srcs}
LIBS
Expand Down Expand Up @@ -259,7 +260,8 @@ ecbuild_add_test(
TARGET
u_aparser
LABELS
unit nightly
unit
nightly
SOURCES
${test_srcs}
INCLUDES
Expand All @@ -284,7 +286,8 @@ if (ENABLE_ALL_TESTS)
TARGET
u_anode_stest
LABELS
unit nightly
unit
nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -311,7 +314,8 @@ if (ENABLE_ALL_TESTS)
TARGET
perf_aparser
LABELS
performance nightly
performance
nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -338,9 +342,10 @@ if (ENABLE_ALL_TESTS)
TARGET
perf_aparser_timer
LABELS
performance nightly
performance
nightly
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def
${CMAKE_CURRENT_SOURCE_DIR}/parser/test/data/single_defs/mega.def
SOURCES
${test_srcs}
LIBS
Expand All @@ -362,8 +367,9 @@ if (ENABLE_ALL_TESTS)
perf_aparser_only
LABELS
performance
nightly
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def
${CMAKE_CURRENT_SOURCE_DIR}/parser/test/data/single_defs/mega.def
SOURCES
${test_srcs}
LIBS
Expand Down
2 changes: 2 additions & 0 deletions Client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ if (ENABLE_ALL_TESTS AND ENABLE_SERVER)
perf_test_large_defs
LABELS
performance
manual # requires manual definition of env var ECF_TEST_DEFS_DIR
SOURCES
# Headers
test/SCPort.hpp
Expand Down Expand Up @@ -183,6 +184,7 @@ if (ENABLE_ALL_TESTS AND ENABLE_SERVER)
m_test_migration
LABELS
migration
manual # requires command line argument: m_test_migration <>
SOURCES
# Headers
test/SCPort.hpp
Expand Down
11 changes: 7 additions & 4 deletions Client/test/TestMigration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ void do_test_migration(ClientInvoker& theClient,
}

BOOST_FIXTURE_TEST_CASE(test_migration, ArgsFixture) {
if (argc == 2 && fs::exists(argv[1])) {
if (argc != 2) {
std::cout << "Ignoring test! Since test directory is not provided\n";
}
else if (!fs::exists(argv[1])) {
std::cout << "Ignoring test! Since provided test directory does not exist\n";
}
else {
/// This will remove checkpt and backup , to avoid server from loading it. (i.e from previous test)
InvokeServer invokeServer("Client:: ...test_migration:", SCPort::next());
BOOST_REQUIRE_MESSAGE(invokeServer.server_started(),
Expand All @@ -109,9 +115,6 @@ BOOST_FIXTURE_TEST_CASE(test_migration, ArgsFixture) {
do_test_migration(theClient, invokeServer.host(), invokeServer.port(), argv[1], error_cnt);
BOOST_REQUIRE_MESSAGE(error_cnt == 0, "Migration test failed " << error_cnt << " times ");
}
else {
std::cout << "Ignoring test, since directory " << argv[1] << " not found\n";
}
}

BOOST_AUTO_TEST_SUITE_END()
15 changes: 8 additions & 7 deletions Client/test/TestSinglePerf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void time_load_and_downloads(ClientInvoker& theClient,
}

BOOST_AUTO_TEST_CASE(test_perf_for_large_defs) {
if (getenv("ECF_SSL")) {
if (const char* ecf_ssl = getenv("ECF_SSL"); ecf_ssl) {
load_threshold_ms = 8000; // 4500;
begin_threshold_ms = 800; // 400;
sync_full_threshold_s = 4.5; // 2.6;
Expand All @@ -367,8 +367,13 @@ BOOST_AUTO_TEST_CASE(test_perf_for_large_defs) {
client_cmds_threshold_s = 950; // 8.5;
}

char* ecf_test_defs_dir = getenv("ECF_TEST_DEFS_DIR");
if (ecf_test_defs_dir && fs::exists(ecf_test_defs_dir)) {
if (const char* ecf_test_defs_dir = getenv("ECF_TEST_DEFS_DIR"); !ecf_test_defs_dir) {
std::cout << "Ignoring test! Environment variable ECF_TEST_DEFS_DIR is not defined\n";
}
else if (!fs::exists(ecf_test_defs_dir)) {
std::cout << "Ignoring test! Test definitions directory " << ecf_test_defs_dir << " does not exist\n";
}
else {
/// This will remove checkpt and backup , to avoid server from loading it. (i.e from previous test)
InvokeServer invokeServer("Client:: ...test_perf_for_large_defs:", SCPort::next());
BOOST_REQUIRE_MESSAGE(invokeServer.server_started(),
Expand All @@ -377,10 +382,6 @@ BOOST_AUTO_TEST_CASE(test_perf_for_large_defs) {
ClientInvoker theClient(invokeServer.host(), invokeServer.port());
time_load_and_downloads(theClient, invokeServer.host(), invokeServer.port(), ecf_test_defs_dir);
}
else {
std::cout << "Ingoring test, since directory defined by environment variable(ECF_TEST_DEFS_DIR) "
<< ecf_test_defs_dir << " does not exist";
}
}

BOOST_AUTO_TEST_SUITE_END()
9 changes: 6 additions & 3 deletions Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ if (ENABLE_ALL_TESTS)
TARGET
s_test
LABELS
integration nightly
integration
nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -92,7 +93,8 @@ if (ENABLE_ALL_TESTS)
TARGET
s_test_zombies
LABELS
integration nightly
integration
nightly
SOURCES
TestZombies.cpp
LIBS
Expand All @@ -108,7 +110,8 @@ if (ENABLE_ALL_TESTS)
TARGET
s_singletest
LABELS
integration nightly
integration
manual
SOURCES
TestSingle.cpp
LIBS
Expand Down

0 comments on commit 1c75073

Please sign in to comment.