diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d4efa20c..ea4cf6e1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,6 +7,7 @@ on: branches: - develop - master + - "*CI" jobs: Coverage: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 98be505f..3bbec934 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,31 +35,27 @@ find_program(TOUCH_EXECUTABLE NAMES gtouch touch REQUIRED) # #----------------------------------------------------------------------------- -set(MAP_NAME "default") +set(DEFAULT_MAP_NAME "default") +set(HTTPD0_HOST "0.0.0.0") set(HTTPD0_PORT "59980") +set(HTTPD1_HOST "0.0.0.0") set(HTTPD1_PORT "59981") set(RENDERD1_HOST "0.0.0.0") set(RENDERD1_PORT "59991") set(WWW_USER_NAME "nobody") -set(TILE_DEFAULT_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example/9/297/191.png") -set(TILE_JPG_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example-jpg/9/297/191.jpg") -set(TILE_PNG256_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example-png256/9/297/191.png") -set(TILE_PNG32_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example-png32/9/297/191.png") -set(TILE_WEBP_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example-webp/9/297/191.webp") +set(MAP_NAMES "jpg" "png256" "png32" "webp") -set(TILE_DIRTY_OFF_URL "http://localhost:${HTTPD1_PORT}/tiles/renderd-example/9/297/191.png/dirty") -set(TILE_DIRTY_ON_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example/9/297/191.png/dirty") -set(TILE_STATUS_OFF_URL "http://localhost:${HTTPD1_PORT}/tiles/renderd-example/9/297/191.png/status") -set(TILE_STATUS_ON_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example/9/297/191.png/status") +set(TILE_ZXY "9/297/191") -set(METRICS_URL "http://localhost:${HTTPD0_PORT}/metrics") -set(MOD_TILE_URL "http://localhost:${HTTPD0_PORT}/mod_tile") -set(TILE_DEFAULT_TILEJSON_URL "http://localhost:${HTTPD0_PORT}/tiles/renderd-example/tile-layer.json") +set(METRICS_OFF_URL "http://${HTTPD1_HOST}:${HTTPD1_PORT}/metrics") +set(METRICS_ON_URL "http://${HTTPD0_HOST}:${HTTPD0_PORT}/metrics") +set(MOD_TILE_OFF_URL "http://${HTTPD1_HOST}:${HTTPD1_PORT}/mod_tile") +set(MOD_TILE_ON_URL "http://${HTTPD0_HOST}:${HTTPD0_PORT}/mod_tile") +set(TILE_DEFAULT_TILEJSON_URL "http://${HTTPD0_HOST}:${HTTPD0_PORT}/tiles/${DEFAULT_MAP_NAME}/tile-layer.json") -set(TILE_DEFAULT_SHA256SUM "dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08") set(TILE_JPG_SHA256SUM "e09c3406c02f03583dadf0c8404c2d3efdc06a40d399e381ed2f47f49fde42d7") -set(TILE_PNG256_SHA256SUM "${TILE_DEFAULT_SHA256SUM}") +set(TILE_PNG256_SHA256SUM "dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08") set(TILE_PNG32_SHA256SUM "1006d92152f1e18896e0016fb43201b14bbcf7655955b74495ad3610541d325b") set(TILE_WEBP_SHA256SUM_4 "ef3862a57831b21ec69c15be196e1e2b4fea66246c361142631b9fa22b85decc") # libwebp.so.4 set(TILE_WEBP_SHA256SUM_6 "96fc0455b2269a7bcd4a5b3c9844529c3c77e3bb15f56e72f78a5af3bc15b6b5") # libwebp.so.6 @@ -67,6 +63,42 @@ set(TILE_WEBP_SHA256SUM_7 "a82ef9ba5dc333de88af7b645084c30ab2b01c664e17162cbf665 set(CURL_CMD "${CURL_EXECUTABLE} --fail --silent") +set(HTTPD_START_CMD + "${HTTPD_EXECUTABLE} -e debug -f ${PROJECT_BINARY_DIR}/tests/conf/httpd.conf -k start" +) +string(REPLACE ";" "\n" HTTPD_START_CMD_STR "${HTTPD_START_CMD}") + +set(HTTPD_STOP_CMD + "${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/httpd.pid)" + "${RM} run/httpd.pid" +) +string(REPLACE ";" "\n" HTTPD_STOP_CMD_STR "${HTTPD_STOP_CMD}") + +set(HTTPD_PID + "run/httpd.pid" +) + +set(RENDERD_START_CMD + "$ --config conf/renderd.conf --foreground --slave 0 > logs/renderd0.log 2>&1 &" + "printf \${!} > run/renderd0.pid" + "$ --config conf/renderd.conf --foreground --slave 1 > logs/renderd1.log 2>&1 &" + "printf \${!} > run/renderd1.pid" +) +string(REPLACE ";" "\n" RENDERD_START_CMD_STR "${RENDERD_START_CMD}") + +set(RENDERD_STOP_CMD + "${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/renderd1.pid)" + "${RM} run/renderd1.pid" + "${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/renderd0.pid)" + "${RM} run/renderd0.pid" +) +string(REPLACE ";" "\n" RENDERD_STOP_CMD_STR "${RENDERD_STOP_CMD}") + +set(RENDERD_PIDS + "run/renderd0.pid" + "run/renderd1.pid" +) + execute_process(COMMAND ${ID_EXECUTABLE} -gn ${WWW_USER_NAME} OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE WWW_GROUP_NAME @@ -100,33 +132,29 @@ add_test( ) add_test( NAME start_renderd - COMMAND ${BASH} -c " - echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground \ - --slave 0 > ${PROJECT_BINARY_DIR}/tests/logs/renderd0.log 2>&1 &' > ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - echo 'printf \${!} > ${PROJECT_BINARY_DIR}/tests/run/renderd0.pid' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground \ - --slave 1 > ${PROJECT_BINARY_DIR}/tests/logs/renderd1.log 2>&1 &' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - echo 'printf \${!} > ${PROJECT_BINARY_DIR}/tests/run/renderd1.pid' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - echo 'exit 0' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - ${BASH} ${PROJECT_BINARY_DIR}/tests/renderd_start.sh - " + COMMAND ${BASH} -c "${RENDERD_START_CMD_STR}" WORKING_DIRECTORY tests ) add_test( NAME start_httpd - COMMAND ${HTTPD_EXECUTABLE} -e debug -f ${PROJECT_BINARY_DIR}/tests/conf/httpd.conf -k start + COMMAND ${BASH} -c "${HTTPD_START_CMD_STR}" WORKING_DIRECTORY tests ) add_test( NAME render_speedtest - COMMAND render_speedtest --map ${MAP_NAME} --max-zoom 10 --socket ${PROJECT_BINARY_DIR}/tests/run/renderd0.sock + COMMAND ${BASH} -c " + $ \ + --map ${DEFAULT_MAP_NAME} \ + --max-zoom 10 \ + --socket ${PROJECT_BINARY_DIR}/tests/run/renderd0.sock + " WORKING_DIRECTORY tests ) add_test( NAME render_expired COMMAND ${BASH} -c " - echo '0/0/0' | ${PROJECT_BINARY_DIR}/src/render_expired \ - --map ${MAP_NAME} \ + echo '0/0/0' | $ \ + --map ${DEFAULT_MAP_NAME} \ --max-zoom 5 \ --min-zoom 0 \ --num-threads 1 \ @@ -138,10 +166,10 @@ add_test( add_test( NAME render_list COMMAND ${BASH} -c " - ${PROJECT_BINARY_DIR}/src/render_list \ + $ \ --all \ --force \ - --map ${MAP_NAME} \ + --map ${DEFAULT_MAP_NAME} \ --max-zoom 5 \ --min-zoom 0 \ --num-threads 1 \ @@ -154,9 +182,9 @@ add_test( NAME render_old COMMAND ${BASH} -c " ${TOUCH_EXECUTABLE} -d '+1 month' ${PROJECT_BINARY_DIR}/tests/tiles/planet-import-complete - ${PROJECT_BINARY_DIR}/src/render_old \ + $ \ --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf \ - --map ${MAP_NAME} \ + --map ${DEFAULT_MAP_NAME} \ --max-zoom 5 \ --min-zoom 0 \ --num-threads 1 \ @@ -165,141 +193,145 @@ add_test( " WORKING_DIRECTORY tests ) -add_test( - NAME download_tiles - COMMAND ${BASH} -c " - until $(${CURL_CMD} ${TILE_DEFAULT_URL} --output tile.png); do - echo 'Sleeping 1s (DEFAULT)'; - sleep 1; - done - until $(${CURL_CMD} ${TILE_JPG_URL} --output tile.jpg); do - echo 'Sleeping 1s (JPG)'; - sleep 1; - done - until $(${CURL_CMD} ${TILE_PNG256_URL} --output tile.png256); do - echo 'Sleeping 1s (PNG256)'; - sleep 1; - done - until $(${CURL_CMD} ${TILE_PNG32_URL} --output tile.png32); do - echo 'Sleeping 1s (PNG32)'; - sleep 1; - done - until $(${CURL_CMD} ${TILE_WEBP_URL} --output tile.webp); do - echo 'Sleeping 1s (WEBP)'; - sleep 1; - done - " - WORKING_DIRECTORY tests -) + +foreach(MAP_NAME IN LISTS MAP_NAMES) + string(REGEX REPLACE "[0-9]+" "" EXTENSION ${MAP_NAME}) + set(HTTPD0_URL "http://${HTTPD0_HOST}:${HTTPD0_PORT}/tiles/${MAP_NAME}/${TILE_ZXY}.${EXTENSION}") + set(HTTPD1_URL "http://${HTTPD1_HOST}:${HTTPD1_PORT}/tiles/${MAP_NAME}/${TILE_ZXY}.${EXTENSION}") + add_test( + NAME download_tile_${MAP_NAME} + COMMAND ${BASH} -c " + until $(${CURL_CMD} ${HTTPD0_URL} --output tile.${MAP_NAME}.0); do + echo 'Sleeping 1s (${MAP_NAME}.0)'; + sleep 1; + done + until $(${CURL_CMD} ${HTTPD1_URL} --output tile.${MAP_NAME}.1); do + echo 'Sleeping 1s (${MAP_NAME}.1)'; + sleep 1; + done + " + WORKING_DIRECTORY tests + ) + set_tests_properties(download_tile_${MAP_NAME} PROPERTIES + FIXTURES_REQUIRED httpd_started + FIXTURES_SETUP tiles_downloaded + TIMEOUT 10 + ) + add_test( + NAME status_and_dirty_${MAP_NAME} + COMMAND ${BASH} -c " + TILE_DIRTY_ON_CMD=\"${CURL_CMD} ${HTTPD0_URL}/dirty\" + TILE_STATUS_ON_CMD=\"${CURL_CMD} ${HTTPD0_URL}/status\" + TILE_LAST_RENDERED_AT_OLD=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.') + echo \"Tile Last Rendered At (Old): \${TILE_LAST_RENDERED_AT_OLD}\" + sleep 1 + TILE_DIRTY_ON_OUTPUT=$(\${TILE_DIRTY_ON_CMD}) + echo \"Dirty: \${TILE_DIRTY_ON_OUTPUT}\" + if [ \"\${TILE_DIRTY_ON_OUTPUT}\" != \"Tile submitted for rendering\" ]; then + exit 1; + fi + TILE_LAST_RENDERED_AT_NEW=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.') + echo \"Tile Last Rendered At (New): \${TILE_LAST_RENDERED_AT_NEW}\" + until [ \"\${TILE_LAST_RENDERED_AT_OLD}\" != \"\${TILE_LAST_RENDERED_AT_NEW}\" ]; do + echo 'Sleeping 1s'; + sleep 1; + TILE_LAST_RENDERED_AT_NEW=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.'); + echo \"Tile Last Rendered At (New): \${TILE_LAST_RENDERED_AT_NEW}\"; + done + TILE_DIRTY_OFF_CODE=$(${CURL_CMD} --write-out '%{http_code}' ${HTTPD1_URL}/dirty) + echo \"Dirty Off code: '\${TILE_DIRTY_OFF_CODE}'\" + if [ \"\${TILE_DIRTY_OFF_CODE}\" != \"404\" ]; then + exit 1; + fi + TILE_STATUS_OFF_CODE=$(${CURL_CMD} --write-out '%{http_code}' ${HTTPD1_URL}/status) + echo \"Status Off code: '\${TILE_STATUS_OFF_CODE}'\" + if [ \"\${TILE_STATUS_OFF_CODE}\" != \"404\" ]; then + exit 1; + fi + " + WORKING_DIRECTORY tests + ) + set_tests_properties(status_and_dirty_${MAP_NAME} PROPERTIES + DEPENDS_ON download_tile_${MAP_NAME} + FIXTURES_REQUIRED httpd_started + TIMEOUT 20 + ) + add_test( + NAME remove_tile_${MAP_NAME} + COMMAND ${RM} -v tile.${MAP_NAME}.0 tile.${MAP_NAME}.1 + WORKING_DIRECTORY tests + ) + set_tests_properties(remove_tile_${MAP_NAME} PROPERTIES + DEPENDS_ON download_tile_${MAP_NAME} + FIXTURES_CLEANUP tiles_downloaded + REQUIRED_FILES "tile.${MAP_NAME}.0;tile.${MAP_NAME}.1" + ) +endforeach() + add_test( NAME check_tiles COMMAND ${BASH} -c " - (echo '${TILE_DEFAULT_SHA256SUM} tile.png' | ${SHA256SUM_EXECUTABLE} -c) && \ - (echo '${TILE_JPG_SHA256SUM} tile.jpg' | ${SHA256SUM_EXECUTABLE} -c) && \ - (echo '${TILE_PNG256_SHA256SUM} tile.png256' | ${SHA256SUM_EXECUTABLE} -c) && \ - (echo '${TILE_PNG32_SHA256SUM} tile.png32' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_JPG_SHA256SUM} tile.jpg.0' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_JPG_SHA256SUM} tile.jpg.1' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_PNG256_SHA256SUM} tile.png256.0' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_PNG256_SHA256SUM} tile.png256.1' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_PNG32_SHA256SUM} tile.png32.0' | ${SHA256SUM_EXECUTABLE} -c) && \ + (echo '${TILE_PNG32_SHA256SUM} tile.png32.1' | ${SHA256SUM_EXECUTABLE} -c) && \ ( \ - (echo '${TILE_WEBP_SHA256SUM_7} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || \ - (echo '${TILE_WEBP_SHA256SUM_6} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || \ - (echo '${TILE_WEBP_SHA256SUM_4} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) \ + (echo '${TILE_WEBP_SHA256SUM_7} tile.webp.0' | ${SHA256SUM_EXECUTABLE} -c) || \ + (echo '${TILE_WEBP_SHA256SUM_6} tile.webp.0' | ${SHA256SUM_EXECUTABLE} -c) || \ + (echo '${TILE_WEBP_SHA256SUM_4} tile.webp.0' | ${SHA256SUM_EXECUTABLE} -c) \ + ) && \ + ( \ + (echo '${TILE_WEBP_SHA256SUM_7} tile.webp.1' | ${SHA256SUM_EXECUTABLE} -c) || \ + (echo '${TILE_WEBP_SHA256SUM_6} tile.webp.1' | ${SHA256SUM_EXECUTABLE} -c) || \ + (echo '${TILE_WEBP_SHA256SUM_4} tile.webp.1' | ${SHA256SUM_EXECUTABLE} -c) \ ) " WORKING_DIRECTORY tests ) add_test( - NAME status_and_dirty_urls - COMMAND ${BASH} -c " - TILE_DIRTY_ON_CMD=\"${CURL_CMD} ${TILE_DIRTY_ON_URL}\" - TILE_STATUS_ON_CMD=\"${CURL_CMD} ${TILE_STATUS_ON_URL}\" - TILE_LAST_RENDERED_AT_OLD=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.') - echo \"Tile Last Rendered At (Old): \${TILE_LAST_RENDERED_AT_OLD}\" - sleep 5; - TILE_DIRTY_ON_OUTPUT=$(\${TILE_DIRTY_ON_CMD}) - echo \"Dirty: \${TILE_DIRTY_ON_OUTPUT}\" - if [ \"\${TILE_DIRTY_ON_OUTPUT}\" != \"Tile submitted for rendering\" ]; then - exit 1; - fi - TILE_LAST_RENDERED_AT_NEW=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.') - echo \"Tile Last Rendered At (New): \${TILE_LAST_RENDERED_AT_NEW}\" - until [ \"\${TILE_LAST_RENDERED_AT_OLD}\" != \"\${TILE_LAST_RENDERED_AT_NEW}\" ]; do - echo 'Sleeping 1s'; - sleep 1; - TILE_LAST_RENDERED_AT_NEW=$(\${TILE_STATUS_ON_CMD} | ${GREP_EXECUTABLE} -o 'Last rendered at [^\\.]*.'); - echo \"Tile Last Rendered At (New): \${TILE_LAST_RENDERED_AT_NEW}\"; - done - TILE_DIRTY_OFF_CODE=$(${CURL_CMD} --write-out '%{http_code}' ${TILE_DIRTY_OFF_URL}) - echo \"Dirty Off code: '\${TILE_DIRTY_OFF_CODE}'\" - if [ \"\${TILE_DIRTY_OFF_CODE}\" != \"404\" ]; then - exit 1; - fi - TILE_STATUS_OFF_CODE=$(${CURL_CMD} --write-out '%{http_code}' ${TILE_STATUS_OFF_URL}) - echo \"Status Off code: '\${TILE_STATUS_OFF_CODE}'\" - if [ \"\${TILE_STATUS_OFF_CODE}\" != \"404\" ]; then - exit 1; - fi - " - WORKING_DIRECTORY tests -) -add_test( - NAME metrics_url - COMMAND ${BASH} -c " - METRICS_CMD=\"${CURL_CMD} ${METRICS_URL}\" - METRICS_OUTPUT=$(\${METRICS_CMD}) - echo \"\${METRICS_OUTPUT}\" - for LAYER in '' '-jpg' '-png256' '-png32' '-webp'; do - LAYER_200=\"modtile_layer_responses_total{layer=\\\"/tiles/renderd-example\${LAYER}/\\\",status=\\\"200\\\"} 1\" - LAYER_404=\"modtile_layer_responses_total{layer=\\\"/tiles/renderd-example\${LAYER}/\\\",status=\\\"404\\\"} 0\" - echo \"\${LAYER_200}\" - echo \"\${LAYER_404}\" - if [[ \"\${METRICS_OUTPUT}\" != *\"\${LAYER_200}\"* ]]; then - exit 1; - fi - if [[ \"\${METRICS_OUTPUT}\" != *\"\${LAYER_404}\"* ]]; then - exit 1; - fi - done - " - WORKING_DIRECTORY tests -) -add_test( - NAME mod_tile_url + NAME stats_urls COMMAND ${BASH} -c " - MOD_TILE_CMD=\"${CURL_CMD} ${MOD_TILE_URL}\" - MOD_TILE_OUTPUT=$(\${MOD_TILE_CMD}) - echo \"\${MOD_TILE_OUTPUT}\" - for LAYER in '' '-jpg' '-png256' '-png32' '-webp'; do - LAYER_200=\"NoRes200Layer/tiles/renderd-example\${LAYER}/: 1\" - LAYER_404=\"NoRes404Layer/tiles/renderd-example\${LAYER}/: 0\" - echo \"\${LAYER_200}\" - echo \"\${LAYER_404}\" - if [[ \"\${MOD_TILE_OUTPUT}\" != *\"\${LAYER_200}\"* ]]; then + METRICS_ON_CMD=\"${CURL_CMD} ${METRICS_ON_URL}\" + METRICS_ON_OUTPUT=$(\${METRICS_ON_CMD}) + echo \"Metrics On output: \${METRICS_ON_OUTPUT}\" + MOD_TILE_ON_CMD=\"${CURL_CMD} ${MOD_TILE_ON_URL}\" + MOD_TILE_ON_OUTPUT=$(\${MOD_TILE_ON_CMD}) + echo \"Mod_tile On output: \${MOD_TILE_ON_OUTPUT}\" + for LAYER in 'jpg' 'png256' 'png32' 'webp'; do + METRICS_LAYER_200=\"modtile_layer_responses_total{layer=\\\"/tiles/\${LAYER}/\\\",status=\\\"200\\\"} 1\" + echo \"\${METRICS_LAYER_200}\" + if [[ \"\${METRICS_ON_OUTPUT}\" != *\"\${METRICS_LAYER_200}\"* ]]; then exit 1; fi - if [[ \"\${MOD_TILE_OUTPUT}\" != *\"\${LAYER_404}\"* ]]; then + MOD_TILE_LAYER_200=\"NoRes200Layer/tiles/\${LAYER}/: 1\" + echo \"\${MOD_TILE_LAYER_200}\" + if [[ \"\${MOD_TILE_ON_OUTPUT}\" != *\"\${MOD_TILE_LAYER_200}\"* ]]; then exit 1; fi done + METRICS_OFF_OUTPUT=$(${CURL_CMD} ${METRICS_OFF_URL}) + echo \"Metrics Off output: '\${METRICS_OFF_OUTPUT}'\" + if [ \"\${METRICS_OFF_OUTPUT}\" != \"Stats are not enabled for this server\" ]; then + exit 1; + fi + MOD_TILE_OFF_OUTPUT=$(${CURL_CMD} ${MOD_TILE_OFF_URL}) + echo \"Mod_tile Off output: '\${MOD_TILE_OFF_OUTPUT}'\" + if [ \"\${MOD_TILE_OFF_OUTPUT}\" != \"Stats are not enabled for this server\" ]; then + exit 1; + fi " WORKING_DIRECTORY tests ) -add_test( - NAME remove_tiles - COMMAND ${RM} -v tile.png tile.jpg tile.png256 tile.png32 tile.webp - WORKING_DIRECTORY tests -) add_test( NAME stop_renderd - COMMAND ${BASH} -c " - ${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/renderd1.pid) && ${RM} run/renderd1.pid - ${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/renderd0.pid) && ${RM} run/renderd0.pid - " + COMMAND ${BASH} -c "${RENDERD_STOP_CMD_STR}" WORKING_DIRECTORY tests ) add_test( NAME stop_httpd - COMMAND ${BASH} -c " - ${KILL_EXECUTABLE} $(${CAT_EXECUTABLE} run/httpd.pid) && ${RM} run/httpd.pid - " + COMMAND ${BASH} -c "${HTTPD_STOP_CMD_STR}" WORKING_DIRECTORY tests ) add_test( @@ -324,11 +356,11 @@ set_tests_properties(start_httpd PROPERTIES ) set_tests_properties(stop_renderd PROPERTIES FIXTURES_CLEANUP httpd_started - REQUIRED_FILES "run/renderd0.pid;run/renderd1.pid" + REQUIRED_FILES "${RENDERD_PIDS}" ) set_tests_properties(stop_httpd PROPERTIES FIXTURES_CLEANUP httpd_started - REQUIRED_FILES run/httpd.pid + REQUIRED_FILES "${HTTPD_PID}" ) set_tests_properties(clear_dirs PROPERTIES DEPENDS "stop_renderd;stop_httpd" @@ -355,35 +387,13 @@ set_tests_properties(render_old PROPERTIES FIXTURES_REQUIRED httpd_started TIMEOUT 60 ) -set_tests_properties(download_tiles PROPERTIES - FIXTURES_REQUIRED httpd_started - FIXTURES_SETUP tiles_downloaded - TIMEOUT 60 -) set_tests_properties(check_tiles PROPERTIES - DEPENDS download_tiles - FIXTURES_REQUIRED "httpd_started;tiles_downloaded" - REQUIRED_FILES "tile.png;tile.jpg;tile.png256;tile.png32;tile.webp" -) -set_tests_properties(status_and_dirty_urls PROPERTIES - DEPENDS download_tiles - FIXTURES_REQUIRED "httpd_started;tiles_downloaded" - REQUIRED_FILES "tile.png;tile.jpg;tile.png256;tile.png32;tile.webp" - TIMEOUT 60 -) -set_tests_properties(metrics_url PROPERTIES - DEPENDS download_tiles - FIXTURES_REQUIRED "httpd_started;tiles_downloaded" + FIXTURES_REQUIRED tiles_downloaded ) -set_tests_properties(mod_tile_url PROPERTIES - DEPENDS download_tiles +set_tests_properties(stats_urls PROPERTIES FIXTURES_REQUIRED "httpd_started;tiles_downloaded" ) -set_tests_properties(remove_tiles PROPERTIES - DEPENDS download_tiles - FIXTURES_CLEANUP tiles_downloaded - REQUIRED_FILES "tile.png;tile.jpg;tile.png256;tile.png32;tile.webp" -) + if(JQ_EXECUTABLE) add_test( diff --git a/tests/httpd.conf.in b/tests/httpd.conf.in index a82be662..2eb569e2 100644 --- a/tests/httpd.conf.in +++ b/tests/httpd.conf.in @@ -14,7 +14,7 @@ Redirect /renderd-example-map/leaflet/leaflet.min.js https://unpkg.com/leaflet/d LoadModule tile_module @PROJECT_BINARY_DIR@/src/mod_tile.so - + LoadTileConfigFile @PROJECT_BINARY_DIR@/tests/conf/renderd.conf ModTileBulkMode Off ModTileCacheDurationDirty 900 @@ -38,7 +38,7 @@ Redirect /renderd-example-map/leaflet/leaflet.min.js https://unpkg.com/leaflet/d ModTileTileDir @PROJECT_BINARY_DIR@/tests/tiles - + LoadTileConfigFile @PROJECT_BINARY_DIR@/tests/conf/renderd.conf ModTileBulkMode Off ModTileCacheDurationDirty 900 @@ -48,7 +48,7 @@ Redirect /renderd-example-map/leaflet/leaflet.min.js https://unpkg.com/leaflet/d ModTileCacheDurationMinimum 10800 ModTileCacheLastModifiedFactor 0.20 ModTileEnableDirtyURL Off - ModTileEnableStats On + ModTileEnableStats Off ModTileEnableStatusURL Off ModTileEnableTileThrottling Off ModTileEnableTileThrottlingXForward 0 diff --git a/tests/renderd.conf.in b/tests/renderd.conf.in index 0a41161d..91298449 100644 --- a/tests/renderd.conf.in +++ b/tests/renderd.conf.in @@ -3,33 +3,33 @@ font_dir=@MAPNIK_FONTS_DIR@ font_dir_recurse=@MAPNIK_FONTS_DIR_RECURSE@ plugins_dir=@MAPNIK_PLUGINS_DIR@ -[@MAP_NAME@] +[@DEFAULT_MAP_NAME@] TILEDIR=@PROJECT_BINARY_DIR@/tests/tiles -URI=/tiles/renderd-example +URI=/tiles/@DEFAULT_MAP_NAME@ XML=@PROJECT_SOURCE_DIR@/utils/example-map/mapnik.xml -[@MAP_NAME@_jpg] +[jpg] TILEDIR=@PROJECT_BINARY_DIR@/tests/tiles TYPE=jpg image/jpeg jpeg -URI=/tiles/renderd-example-jpg +URI=/tiles/jpg XML=@PROJECT_SOURCE_DIR@/utils/example-map/mapnik.xml -[@MAP_NAME@_png256] +[png256] TILEDIR=@PROJECT_BINARY_DIR@/tests/tiles TYPE=png image/png png256 -URI=/tiles/renderd-example-png256 +URI=/tiles/png256 XML=@PROJECT_SOURCE_DIR@/utils/example-map/mapnik.xml -[@MAP_NAME@_png32] +[png32] TILEDIR=@PROJECT_BINARY_DIR@/tests/tiles TYPE=png image/png png32 -URI=/tiles/renderd-example-png32 +URI=/tiles/png32 XML=@PROJECT_SOURCE_DIR@/utils/example-map/mapnik.xml -[@MAP_NAME@_webp] +[webp] TILEDIR=@PROJECT_BINARY_DIR@/tests/tiles TYPE=webp image/webp webp -URI=/tiles/renderd-example-webp +URI=/tiles/webp XML=@PROJECT_SOURCE_DIR@/utils/example-map/mapnik.xml [renderd1]