diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 42d134fef..a75af3307 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,6 +14,19 @@ endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) +if (HAVE_FDB_REMOTE) + ecbuild_configure_file( fdb_remote_cleanup.sh.in fdb_remote_cleanup.sh @ONLY ) + + ecbuild_add_test( + TARGET fdb_test_remote_cleanup + TYPE SCRIPT + COMMAND fdb_remote_cleanup.sh + TEST_PROPERTIES + RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests + LABELS remotefdb + ) +endif() + add_subdirectory( fdb ) add_subdirectory( chunked_data_view ) add_subdirectory( regressions ) diff --git a/tests/fdb/remote/CMakeLists.txt b/tests/fdb/remote/CMakeLists.txt index 4b7819057..d14feaba1 100644 --- a/tests/fdb/remote/CMakeLists.txt +++ b/tests/fdb/remote/CMakeLists.txt @@ -16,17 +16,18 @@ if (HAVE_FDB_BUILD_TOOLS AND HAVE_GRIB) ecbuild_configure_file( store.yaml.in store.yaml @ONLY ) ecbuild_configure_file( client.yaml.in client.yaml @ONLY ) - ecbuild_add_test( - TARGET fdb_test_remote_api - TYPE SCRIPT - COMMAND ${FDB_TEST_SERVER_SCRIPT} - ARGS ${CMAKE_CURRENT_BINARY_DIR} client.yaml catalogue.yaml store.yaml - TEST_DEPENDS fdb_test_remote_api_bin - ENVIRONMENT "${test_environment}" - TEST_PROPERTIES - TIMEOUT 300 - RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests - LABELS remotefdb - ) + # ecbuild_add_test( + # TARGET fdb_test_remote_api + # TYPE SCRIPT + # COMMAND ${FDB_TEST_SERVER_SCRIPT} + # ARGS ${CMAKE_CURRENT_BINARY_DIR} client.yaml catalogue.yaml store.yaml + # TEST_DEPENDS "fdb_test_remote_cleanup;fdb_test_remote_api_bin" + # ENVIRONMENT "${test_environment}" + # TEST_PROPERTIES + # TIMEOUT 300 + # RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests + # RUN_SERIAL TRUE + # LABELS remotefdb + # ) endif() diff --git a/tests/fdb_remote_cleanup.sh.in b/tests/fdb_remote_cleanup.sh.in new file mode 100755 index 000000000..c5146b175 --- /dev/null +++ b/tests/fdb_remote_cleanup.sh.in @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +killall fdb-server || true \ No newline at end of file diff --git a/tests/regressions/FDB-419/CMakeLists.txt b/tests/regressions/FDB-419/CMakeLists.txt index 2c2cc4f34..19ae2da65 100644 --- a/tests/regressions/FDB-419/CMakeLists.txt +++ b/tests/regressions/FDB-419/CMakeLists.txt @@ -17,6 +17,7 @@ ecbuild_add_test( SOURCES fdb_419_regression_test.cc LIBS fdb5 eckit metkit ENVIRONMENT FDB_SERVER_EXECUTABLE=$ + TEST_DEPENDS fdb_test_remote_cleanup ENVIRONMENT "${test_environment}" TEST_PROPERTIES RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests diff --git a/tests/regressions/FDB-491/CMakeLists.txt b/tests/regressions/FDB-491/CMakeLists.txt index e4c61f993..26be9e48f 100644 --- a/tests/regressions/FDB-491/CMakeLists.txt +++ b/tests/regressions/FDB-491/CMakeLists.txt @@ -13,7 +13,7 @@ ecbuild_add_test( TYPE SCRIPT COMMAND ${FDB_TEST_SERVER_SCRIPT} ARGS ${CMAKE_CURRENT_BINARY_DIR} client.yaml catalogue.yaml store.yaml - TEST_DEPENDS fdb_test_remote_api_bin + TEST_DEPENDS "fdb_test_remote_cleanup;fdb_test_remote_api_bin" ENVIRONMENT "${test_environment}" TEST_PROPERTIES TIMEOUT 300 diff --git a/tests/regressions/FDB-595/CMakeLists.txt b/tests/regressions/FDB-595/CMakeLists.txt index 8206088e4..cac5fb12a 100644 --- a/tests/regressions/FDB-595/CMakeLists.txt +++ b/tests/regressions/FDB-595/CMakeLists.txt @@ -6,6 +6,7 @@ ecbuild_add_test( TARGET FDB-595 TYPE SCRIPT COMMAND ${CMAKE_CURRENT_BINARY_DIR}/FDB-595.sh + TEST_DEPENDS fdb_test_remote_cleanup ENVIRONMENT "${test_environment}" TEST_PROPERTIES RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests diff --git a/tests/regressions/FDB-610/CMakeLists.txt b/tests/regressions/FDB-610/CMakeLists.txt index 64153fc04..4c532f1d2 100644 --- a/tests/regressions/FDB-610/CMakeLists.txt +++ b/tests/regressions/FDB-610/CMakeLists.txt @@ -21,6 +21,7 @@ ecbuild_add_test( TARGET FDB-610 TYPE SCRIPT COMMAND ${CMAKE_CURRENT_BINARY_DIR}/FDB-610.sh + TEST_DEPENDS fdb_test_remote_cleanup ENVIRONMENT "${test_environment}" TEST_PROPERTIES RESOURCE_LOCK fdb_remote_tests # Prevent concurrent runs of remote tests