Skip to content

Commit

Permalink
Allow custom host specification with CTest (openstreetmap#374)
Browse files Browse the repository at this point in the history
* To facilitate running `memcached` tests for all jobs
  * `CentOS`/`Debian`/`Fedora` jobs don't seem to like running `memcached` on `localhost`
  * `FreeBSD` jobs don't seem to like running `memcached` on `0.0.0.0`
  • Loading branch information
hummeltech authored Jan 19, 2024
1 parent 8cca561 commit b3c19c1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/actions/dependencies/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ inputs:
default: >-
apache2
jq
lcov
memcached
fedora-build-dependencies:
default: >-
cairo-devel
Expand All @@ -47,6 +49,8 @@ inputs:
default: >-
httpd
jq
lcov
memcached
freebsd-build-dependencies:
default: >-
apache24
Expand All @@ -61,6 +65,8 @@ inputs:
freebsd-test-dependencies:
default: >-
jq
lcov
memcached
macos-build-dependencies:
default: >-
apr
Expand All @@ -76,6 +82,8 @@ inputs:
default: >-
coreutils
jq
lcov
memcached
opensuse-build-dependencies:
default: >-
apache2-devel
Expand All @@ -92,6 +100,8 @@ inputs:
apache2-event
apache2-prefork
jq
lcov
memcached
opensuse-mapnik-build-dependencies:
default: >-
bzip2
Expand Down Expand Up @@ -129,6 +139,8 @@ inputs:
default: >-
httpd
jq
lcov
memcached
rhel-mapnik-build-dependencies:
default: >-
boost-devel
Expand Down Expand Up @@ -181,6 +193,8 @@ inputs:
default: >-
apache2
jq
lcov
memcached
mapnik-build-version-centos-stream:
default: 3.1.0
mapnik-build-version-amazonlinux2-centos7:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ jobs:
continue-on-error: true
env:
BUILD_PARALLEL_LEVEL: 2
CTEST_HOST: localhost
LIBRARY_PATH: /usr/local/lib
TMPDIR: /tmp
name: >-
Expand Down
17 changes: 13 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,29 @@ find_program(MKDIR_EXECUTABLE NAMES mkdir REQUIRED)
find_program(SHA256SUM_EXECUTABLE NAMES gsha256sum sha256sum REQUIRED)
find_program(TOUCH_EXECUTABLE NAMES gtouch touch REQUIRED)

# Sets the host to be used for CTest test services
if(DEFINED ENV{CTEST_HOST})
# To the value of environment variable "CTEST_HOST"
set(CTEST_HOST "$ENV{CTEST_HOST}")
else()
# Or to 0.0.0.0 by default
set(CTEST_HOST "0.0.0.0")
endif()

#-----------------------------------------------------------------------------
#
# Test configurations
#
#-----------------------------------------------------------------------------

set(DEFAULT_MAP_NAME "default")
set(HTTPD0_HOST "localhost")
set(HTTPD0_HOST "${CTEST_HOST}")
set(HTTPD0_PORT_BASE "59000")
set(HTTPD1_HOST "localhost")
set(HTTPD1_HOST "${CTEST_HOST}")
set(HTTPD1_PORT_BASE "59100")
set(MEMCACHED_HOST "localhost")
set(MEMCACHED_HOST "${CTEST_HOST}")
set(MEMCACHED_PORT_BASE "60000")
set(RENDERD1_HOST "localhost")
set(RENDERD1_HOST "${CTEST_HOST}")
set(RENDERD1_PORT_BASE "59500")

set(CURL_CMD "${CURL_EXECUTABLE} --fail --silent")
Expand Down

0 comments on commit b3c19c1

Please sign in to comment.