From 19d999f8eeafe2285317acf009b2215361d2c4e0 Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Mon, 8 Mar 2021 16:53:49 +0200 Subject: [PATCH] MXS-3417 Indicate a skipped test with a special return value --- system-test/maxtest/src/testconnections.cc | 9 +++++---- system-test/utilities.cmake | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/system-test/maxtest/src/testconnections.cc b/system-test/maxtest/src/testconnections.cc index 8a80a24d5..3bd66bc02 100644 --- a/system-test/maxtest/src/testconnections.cc +++ b/system-test/maxtest/src/testconnections.cc @@ -44,6 +44,7 @@ const StringSet recognized_mdbci_labels = const int MDBCI_FAIL = 200; // Exit code when failure caused by MDBCI non-zero exit const int BROKEN_VM_FAIL = 201; // Exit code when failure caused by broken VMs +const int TEST_SKIPPED = 202; // Exit code when skipping test. Should match value expected by cmake. } namespace maxscale @@ -210,7 +211,7 @@ TestConnections::TestConnections(int argc, char* argv[]) printf("-%c, --%s\n", o->val, o->name); ++o; } - exit(0); + exit(TEST_SKIPPED); } break; @@ -353,7 +354,7 @@ TestConnections::TestConnections(int argc, char* argv[]) if (maxscale::require_columnstore) { cout << "ColumnStore testing is not yet implemented, skipping test" << endl; - exit(0); + exit(TEST_SKIPPED); } std::future repl_future; @@ -482,7 +483,7 @@ TestConnections::TestConnections(int argc, char* argv[]) tprintf("Test requires a higher version of backend servers, skipping test."); tprintf("Required version: %s", maxscale::required_repl_version.c_str()); tprintf("Master-slave version: %s", ver_repl.c_str()); - exit(0); + exit(TEST_SKIPPED); } } @@ -497,7 +498,7 @@ TestConnections::TestConnections(int argc, char* argv[]) tprintf("Test requires a higher version of backend servers, skipping test."); tprintf("Required version: %s", maxscale::required_galera_version.c_str()); tprintf("Galera version: %s", ver_galera.c_str()); - exit(0); + exit(TEST_SKIPPED); } } diff --git a/system-test/utilities.cmake b/system-test/utilities.cmake index 2350876ec..b9a4a844a 100644 --- a/system-test/utilities.cmake +++ b/system-test/utilities.cmake @@ -1,5 +1,7 @@ # Default test timeout set(TEST_TIMEOUT 3600) +# Return code for skipped tests +set(TEST_SKIP_RC 202) # Adds linebreaks to curly brackets in a variable. function(add_linebreaks source_var dest_var) @@ -36,6 +38,7 @@ function(add_test_properties name labels) # Remove the LABELS-string from the list if it's there. list(REMOVE_ITEM labels "LABELS") set_property(TEST ${name} PROPERTY TIMEOUT ${TEST_TIMEOUT}) + set_property(TEST ${name} PROPERTY SKIP_RETURN_CODE ${TEST_SKIP_RC}) set_property(TEST ${name} APPEND PROPERTY LABELS ${labels}) endfunction()