Skip to content
Snippets Groups Projects
Verified Commit 2487af18 authored by David Hoese's avatar David Hoese
Browse files

More CI script refactoring

parent 3be1757c
No related branches found
No related tags found
No related merge requests found
Pipeline #36957 passed
...@@ -35,7 +35,7 @@ start_test_container() { ...@@ -35,7 +35,7 @@ start_test_container() {
} }
kill_test_container() { kill_test_container() {
debug "Curl complete. Killing docker container..." debug "Killing docker container..."
docker kill test >/dev/null docker kill test >/dev/null
debug "Done killing docker container." debug "Done killing docker container."
} }
...@@ -45,11 +45,18 @@ curl_index() { ...@@ -45,11 +45,18 @@ curl_index() {
curl --fail -sS --max-time 5 "http://localhost:8888/" >/dev/null curl --fail -sS --max-time 5 "http://localhost:8888/" >/dev/null
} }
curl_empty_tile() {
debug "Starting curl basic mapfile request..."
# NOTE: The time doesn't actually exist and no image data is available. A blank image should be returned
curl --fail -sS "http://localhost:8888/wms/g16/abi/radf/l1b?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-1330667.479176%2c-2773559.926648%2c2773559.926648%2c1330667.479176&WIDTH=256&HEIGHT=256&FORMAT=rgba&SRS=EPSG%3a930916&LAYERS=C01&TIME=2022-04-20T16:00:21Z" >/dev/null || pg_exit_status=1
}
run_basic_shapefile_tests() { run_basic_shapefile_tests() {
sf_exit_status=0 sf_exit_status=0
debug "Starting shapefile tests..." debug "Starting shapefile tests..."
start_test_container || sf_exit_status=1 start_test_container || sf_exit_status=1
curl_index || sf_exit_status=1 curl_index || sf_exit_status=1
curl_empty_tile || sf_exit_status=1
kill_test_container kill_test_container
return $sf_exit_status return $sf_exit_status
...@@ -61,10 +68,7 @@ run_basic_postgres_tests() { ...@@ -61,10 +68,7 @@ run_basic_postgres_tests() {
start_test_container -e POSTGRES_HOST=localhost -e POSTGRES_PASSWORD_FILE="/secrets/fake_file" || pg_exit_status=1 start_test_container -e POSTGRES_HOST=localhost -e POSTGRES_PASSWORD_FILE="/secrets/fake_file" || pg_exit_status=1
add_shapefile_content add_shapefile_content
curl_index || pg_exit_status=1 curl_index || pg_exit_status=1
curl_empty_tile || pg_exit_status=1
debug "Starting curl basic mapfile request..."
# NOTE: The time doesn't actually exist and no image data is available. A blank image should be returned
curl --fail -sS --max-time 5 "http://localhost:8888/wms/g16/abi/radf/l1b?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-1330667.479176%2c-2773559.926648%2c2773559.926648%2c1330667.479176&WIDTH=256&HEIGHT=256&FORMAT=rgba&SRS=EPSG%3a930916&LAYERS=C01&TIME=2022-04-20T16:00:21Z" >/dev/null || pg_exit_status=1
kill_test_container kill_test_container
return $pg_exit_status return $pg_exit_status
...@@ -72,7 +76,10 @@ run_basic_postgres_tests() { ...@@ -72,7 +76,10 @@ run_basic_postgres_tests() {
exit_status=0 exit_status=0
run_basic_shapefile_tests || exit_status=1 run_basic_shapefile_tests || exit_status=1
echo "#######"
run_basic_postgres_tests || exit_status=1 run_basic_postgres_tests || exit_status=1
echo "#######"
if [[ $exit_status -eq 0 ]]; then if [[ $exit_status -eq 0 ]]; then
debug "SUCCESS" debug "SUCCESS"
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment