Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geosphere-mapserver
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
geosphere
geosphere-mapserver
Commits
6290a127
Verified
Commit
6290a127
authored
2 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add image value checking to testing script
parent
02688ead
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/test_mapserver_image.sh
+26
-1
26 additions, 1 deletion
ci/test_mapserver_image.sh
with
26 additions
and
1 deletion
ci/test_mapserver_image.sh
+
26
−
1
View file @
6290a127
...
@@ -190,9 +190,32 @@ curl_layer_times() {
...
@@ -190,9 +190,32 @@ curl_layer_times() {
curl_empty_tile
()
{
curl_empty_tile
()
{
debug
"Starting curl basic mapfile request..."
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
# 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
curl
--fail
-sS
-o
"empty_tile.png"
"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
check_image_content
"empty_tile.png"
0
}
}
check_image_content
()
{
img_filename
=
$1
pixel_value
=
$2
docker
exec
-i
test
pip
install
pillow
>
/dev/null
incontainer_file
=
"/tmp/
$(
basename
$img_filename
)
"
docker
cp
$img_filename
test
:
${
incontainer_file
}
docker
exec
-i
test
python3
<<
EOF
import sys
import io
import os
import numpy as np
from PIL import Image
img = Image.open("
${
incontainer_file
}
")
img_arr = np.asarray(img)
assert img_arr.shape == (256, 256, 4)
assert (img_arr[:, :, :3] ==
${
pixel_value
}
).all()
EOF
}
run_basic_shapefile_tests
()
{
run_basic_shapefile_tests
()
{
setup_test
setup_test
debug
"Starting shapefile tests..."
debug
"Starting shapefile tests..."
...
@@ -215,6 +238,8 @@ run_basic_postgres_tests() {
...
@@ -215,6 +238,8 @@ run_basic_postgres_tests() {
add_postgres_projections
add_postgres_projections
add_postgres_tables
add_postgres_tables
add_postgres_content
add_postgres_content
# TODO: Verify empty tile is empty
# TODO: Add fake geotiff and tile check for inserted time and verify non-empty result
curl_index
curl_index
curl_layer_times
"[
\"
${
C01_ISOTIME
}
\"
]"
curl_layer_times
"[
\"
${
C01_ISOTIME
}
\"
]"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment