Skip to content

Commit b3c19c1

Browse files
authored
Allow custom host specification with CTest (#374)
* 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`
1 parent 8cca561 commit b3c19c1

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/actions/dependencies/install/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ inputs:
3232
default: >-
3333
apache2
3434
jq
35+
lcov
36+
memcached
3537
fedora-build-dependencies:
3638
default: >-
3739
cairo-devel
@@ -47,6 +49,8 @@ inputs:
4749
default: >-
4850
httpd
4951
jq
52+
lcov
53+
memcached
5054
freebsd-build-dependencies:
5155
default: >-
5256
apache24
@@ -61,6 +65,8 @@ inputs:
6165
freebsd-test-dependencies:
6266
default: >-
6367
jq
68+
lcov
69+
memcached
6470
macos-build-dependencies:
6571
default: >-
6672
apr
@@ -76,6 +82,8 @@ inputs:
7682
default: >-
7783
coreutils
7884
jq
85+
lcov
86+
memcached
7987
opensuse-build-dependencies:
8088
default: >-
8189
apache2-devel
@@ -92,6 +100,8 @@ inputs:
92100
apache2-event
93101
apache2-prefork
94102
jq
103+
lcov
104+
memcached
95105
opensuse-mapnik-build-dependencies:
96106
default: >-
97107
bzip2
@@ -129,6 +139,8 @@ inputs:
129139
default: >-
130140
httpd
131141
jq
142+
lcov
143+
memcached
132144
rhel-mapnik-build-dependencies:
133145
default: >-
134146
boost-devel
@@ -181,6 +193,8 @@ inputs:
181193
default: >-
182194
apache2
183195
jq
196+
lcov
197+
memcached
184198
mapnik-build-version-centos-stream:
185199
default: 3.1.0
186200
mapnik-build-version-amazonlinux2-centos7:

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ jobs:
176176
continue-on-error: true
177177
env:
178178
BUILD_PARALLEL_LEVEL: 2
179+
CTEST_HOST: localhost
179180
LIBRARY_PATH: /usr/local/lib
180181
TMPDIR: /tmp
181182
name: >-

tests/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,29 @@ find_program(MKDIR_EXECUTABLE NAMES mkdir REQUIRED)
3030
find_program(SHA256SUM_EXECUTABLE NAMES gsha256sum sha256sum REQUIRED)
3131
find_program(TOUCH_EXECUTABLE NAMES gtouch touch REQUIRED)
3232

33+
# Sets the host to be used for CTest test services
34+
if(DEFINED ENV{CTEST_HOST})
35+
# To the value of environment variable "CTEST_HOST"
36+
set(CTEST_HOST "$ENV{CTEST_HOST}")
37+
else()
38+
# Or to 0.0.0.0 by default
39+
set(CTEST_HOST "0.0.0.0")
40+
endif()
41+
3342
#-----------------------------------------------------------------------------
3443
#
3544
# Test configurations
3645
#
3746
#-----------------------------------------------------------------------------
3847

3948
set(DEFAULT_MAP_NAME "default")
40-
set(HTTPD0_HOST "localhost")
49+
set(HTTPD0_HOST "${CTEST_HOST}")
4150
set(HTTPD0_PORT_BASE "59000")
42-
set(HTTPD1_HOST "localhost")
51+
set(HTTPD1_HOST "${CTEST_HOST}")
4352
set(HTTPD1_PORT_BASE "59100")
44-
set(MEMCACHED_HOST "localhost")
53+
set(MEMCACHED_HOST "${CTEST_HOST}")
4554
set(MEMCACHED_PORT_BASE "60000")
46-
set(RENDERD1_HOST "localhost")
55+
set(RENDERD1_HOST "${CTEST_HOST}")
4756
set(RENDERD1_PORT_BASE "59500")
4857

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

0 commit comments

Comments
 (0)