Skip to content

Commit 041b008

Browse files
committed
refactor: add warning to CMake if integration tests are enabled but build common is not.
1 parent f45abbf commit 041b008

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ endif()
8080

8181
if(NOT DEFINED DATAFED_DOMAIN)
8282
get_value_from_datafed_sh("DATAFED_DOMAIN" DATAFED_DOMAIN)
83-
message("TESTING: DATAFED_DOMAIN : ${DATAFED_DOMAIN}")
8483
endif()
8584

8685
if(NOT DEFINED DATAFED_DEPENDENCIES_INSTALL_PATH)

repository/gridftp/globus5/authz/tests/integration/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ foreach(PROG
1515
add_test(integration_${PROG} integration_${PROG})
1616

1717
set_tests_properties(integration_${PROG} PROPERTIES FIXTURES_REQUIRED FIX_MOCK)
18-
message("MOCK CORE KEY PATH: ${DATAFED_MOCK_CORE_PUB_KEY}")
1918
set_tests_properties(integration_${PROG} PROPERTIES
2019
ENVIRONMENT "DATAFED_MOCK_CORE_PUB_KEY=${DATAFED_MOCK_CORE_PUB_KEY}"
2120
)

tests/CMakeLists.txt

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11

22
if( ENABLE_INTEGRATION_TESTS )
3+
if( BUILD_COMMON )
4+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_start.sh
5+
${CMAKE_CURRENT_BINARY_DIR}/mock/mock_start.sh
6+
COPYONLY)
37

4-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_start.sh
5-
${CMAKE_CURRENT_BINARY_DIR}/mock/mock_start.sh
6-
COPYONLY)
8+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_stop.sh
9+
${CMAKE_CURRENT_BINARY_DIR}/mock/mock_stop.sh
10+
COPYONLY)
711

8-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_stop.sh
9-
${CMAKE_CURRENT_BINARY_DIR}/mock/mock_stop.sh
10-
COPYONLY)
12+
add_test(NAME start_mock
13+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mock/mock_start.sh
14+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/mock_core
15+
)
1116

12-
add_test(NAME start_mock
13-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mock/mock_start.sh
14-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/mock_core
15-
)
17+
set(DATAFED_MOCK_CORE_PUB_KEY "${CMAKE_BINARY_DIR}/tests/mock_core/mock-datafed-core-key.pub" PARENT_SCOPE)
1618

17-
set(DATAFED_MOCK_CORE_PUB_KEY "${CMAKE_BINARY_DIR}/tests/mock_core/mock-datafed-core-key.pub" PARENT_SCOPE)
19+
# Add a custom target to stop the server
20+
add_test(NAME stop_mock
21+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mock/mock_stop.sh
22+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/mock_core
23+
)
1824

19-
# Add a custom target to stop the server
20-
add_test(NAME stop_mock
21-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mock/mock_stop.sh
22-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/mock_core
23-
)
25+
set_tests_properties(start_mock PROPERTIES FIXTURES_SETUP FIX_MOCK)
26+
set_tests_properties(stop_mock PROPERTIES FIXTURES_CLEANUP FIX_MOCK)
2427

25-
set_tests_properties(start_mock PROPERTIES FIXTURES_SETUP FIX_MOCK)
26-
set_tests_properties(stop_mock PROPERTIES FIXTURES_CLEANUP FIX_MOCK)
27-
28-
add_subdirectory(mock_core)
29-
add_subdirectory(mock)
28+
add_subdirectory(mock_core)
29+
add_subdirectory(mock)
30+
else()
31+
message(WARNING "Integration tests are enabled but build common is disabled, if you wish to run the full suite of integration tests you will need to enable building the common library.")
32+
endif()
3033
endif()
3134

3235
if (ENABLE_END_TO_END_TESTS)
33-
if (NOT ENABLE_END_TO_END_API_TESTS AND NOT ENABLE_END_TO_END_WEB_TESTS)
36+
if (NOT ENABLE_END_TO_END_API_TESTS AND NOT ENABLE_END_TO_END_WEB_TESTS)
3437
message (FATAL_ERROR "Cannot run end-to-end tests because one of the ENABLE_END_TO_END web or API flag is not on")
3538
else()
3639
add_subdirectory(end-to-end)

0 commit comments

Comments
 (0)