Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test action; add test data #60

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: regression-test
on:
pull_request:
jobs:
test-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# build local test image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build test image
uses: docker/build-push-action@v5
with:
push: false
tags: pdok/mapserver:local

- name: Regression test => rectObj wrong projection
kad-korpem marked this conversation as resolved.
Show resolved Hide resolved
run: |
# start WMS and WFS mapservers
docker run -e MAPSERVER_CONFIG_FILE=/srv/data/rectobj.conf -e MS_MAPFILE=/srv/data/rectobj.map -e SERVICE_TYPE=WMS --rm -d \
-p 8181:80 --name mapserver-rectobj-wms -v `pwd`/testdata/rectobj:/srv/data pdok/mapserver:local

docker run -e MAPSERVER_CONFIG_FILE=/srv/data/rectobj.conf -e MS_MAPFILE=/srv/data/rectobj.map -e SERVICE_TYPE=WFS --rm -d \
-p 8182:80 --name mapserver-rectobj-wfs -v `pwd`/testdata/rectobj:/srv/data pdok/mapserver:local

# execute requests
kad-korpem marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p `pwd`/testdata/rectobj/actual
curl "http://localhost:8181/mapserver?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=545287.2873572960962,6867556.049125162885,545689.3385149866808,6868025.580225903541&CRS=EPSG:3857&WIDTH=995&HEIGHT=1162&LAYERS=pand&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE" -sLo `pwd`/testdata/rectobj/actual/rectobj.png
curl "http://localhost:8182/mapserver?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=bag:pand&STARTINDEX=0&COUNT=1000&SRSNAME=urn:ogc:def:crs:EPSG::3857&BBOX=545287.2873572960962,6867556.049125162885,545689.3385149866808,6868025.580225903541,urn:ogc:def:crs:EPSG::3857" -sLo `pwd`/testdata/rectobj/actual/rectobj.xml

# assert results are as expected
exit_code=0

# diff WMS png files, if binary diff exists, check for 'perceptual diff'
wms_diff=$(diff -q `pwd`/testdata/rectobj/expected/wms.png `pwd`/testdata/rectobj/actual/rectobj.png)
if [ -n "$wms_diff" ]
then
echo "binary diff between images, checking for perceptual diff"
kad-korpem marked this conversation as resolved.
Show resolved Hide resolved
wms_pdiff=$(`pwd`/testdata/perceptualdiff `pwd`/testdata/rectobj/expected/wms.png `pwd`/testdata/rectobj/actual/rectobj.png)
if [ -n "$wms_pdiff" ]
then
echo "$wms_pdiff"
exit_code=1
fi
fi
# diff WFS xml files, ignore timestamp but match numberMatched and numberReturned
wfs_diff=$(diff -q `pwd`/testdata/rectobj/expected/wfs.xml `pwd`/testdata/rectobj/actual/rectobj.xml -I 'timeStamp="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}"\snumberMatched="5"\snumberReturned="5"')
if [ -n "$wfs_diff" ]
then
echo "$wfs_diff"
exit_code=1
fi

# cleanup
rm -rf `pwd`/testdata/rectobj/actual

# stop mapservers
docker stop mapserver-rectobj-wms
docker stop mapserver-rectobj-wfs

exit $exit_code
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ RUN mkdir /usr/local/src/mapserver/build && \

#local image lighttpd build from https://github.com/PDOK/lighttpd-docker/tree/PDOK-14748_mapserver_8
# TODO use definitive lighttpd image
FROM pdok/lighttpd:mapserver AS service
FROM pdok/lighttpd:1.4.67-bookworm-rc1 AS service

USER root
LABEL maintainer="PDOK dev <https://github.com/PDOK/mapserver-docker/issues>"
Expand Down
Binary file added testdata/perceptualdiff
Binary file not shown.
112 changes: 112 additions & 0 deletions testdata/rectobj/expected/wfs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=bag:pand&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2 http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
timeStamp="2025-01-20T15:16:22" numberMatched="5" numberReturned="5">
<wfs:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545327.950179 6867645.996197</gml:lowerCorner>
<gml:upperCorner>545741.620449 6867933.162223</gml:upperCorner>
</gml:Envelope>
</wfs:boundedBy>
<!-- WARNING: No featureid defined for typename 'pand'. Output will not validate. -->
<wfs:member>
<ms:pand>
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545327.950179 6867683.091314</gml:lowerCorner>
<gml:upperCorner>545375.395953 6867729.818617</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:geom>
<gml:Polygon gml:id=".1" srsName="urn:ogc:def:crs:EPSG::3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">545375.360477 6867711.041459 545370.293145 6867701.053465 545366.414815 6867693.408727 545364.341729 6867689.325714 545361.896003 6867684.504388 545361.367764 6867683.568373 545361.097984 6867683.091314 545341.313290 6867693.642338 545342.833869 6867696.507313 545328.183170 6867704.682394 545327.950179 6867704.811920 545341.387774 6867729.742950 545341.429766 6867729.818617 545342.306011 6867729.321437 545342.079847 6867728.921691 545343.446736 6867728.144321 545343.672922 6867728.540789 545344.439232 6867728.105140 545344.214691 6867727.707044 545346.968182 6867726.137687 545347.194368 6867726.534155 545347.962324 6867726.096877 545347.736137 6867725.700409 545349.101401 6867724.921389 545349.327577 6867725.319495 545350.210403 6867724.815805 545358.475334 6867720.415843 545358.436611 6867720.340199 545367.199352 6867715.565040 545375.395953 6867711.113803 545375.360477 6867711.041459 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:geom>
</ms:pand>
</wfs:member>
<wfs:member>
<ms:pand>
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545673.760447 6867861.645207</gml:lowerCorner>
<gml:upperCorner>545741.620449 6867902.643860</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:geom>
<gml:Polygon gml:id=".1" srsName="urn:ogc:def:crs:EPSG::3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">545741.239579 6867894.171163 545712.864600 6867863.335530 545711.600356 6867861.961941 545711.498109 6867861.851456 545706.404196 6867861.645207 545674.171939 6867891.453089 545674.072950 6867891.344264 545673.760447 6867891.630593 545673.854576 6867891.732830 545673.908124 6867891.792186 545673.774900 6867891.914201 545674.045931 6867892.207725 545674.118292 6867892.142659 545681.849799 6867900.545840 545683.928566 6867900.628623 545689.989790 6867895.026949 545693.698110 6867899.060320 545695.776876 6867899.143100 545699.638940 6867895.575148 545699.755719 6867895.467772 545699.851899 6867893.059395 545699.572759 6867892.755985 545702.408443 6867890.136562 545704.839562 6867892.778216 545710.588831 6867893.010167 545713.281414 6867890.522522 545715.894301 6867893.362047 545715.540661 6867893.689072 545715.442588 6867896.136767 545715.556191 6867896.260438 545719.103868 6867900.117369 545721.182635 6867900.200143 545725.248648 6867896.443447 545730.873652 6867902.559451 545732.952409 6867902.643860 545741.576287 6867894.666697 545741.472416 6867894.554563 545741.620449 6867894.417897 545741.323458 6867894.094703 545741.239579 6867894.171163 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:geom>
</ms:pand>
</wfs:member>
<wfs:member>
<ms:pand>
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545350.288447 6867716.785233</gml:lowerCorner>
<gml:upperCorner>545404.472306 6867780.931668</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:geom>
<gml:Polygon gml:id=".1" srsName="urn:ogc:def:crs:EPSG::3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">545384.688135 6867763.076023 545372.250819 6867737.892793 545379.019932 6867734.239811 545379.749659 6867735.599990 545387.901777 6867731.202509 545381.016898 6867716.802172 545380.935279 6867716.785233 545350.338145 6867733.293959 545350.288447 6867733.391949 545363.112067 6867757.999325 545374.439858 6867780.931668 545404.472306 6867766.011822 545400.016096 6867756.535919 545399.600194 6867755.666207 545384.688135 6867763.076023 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:geom>
</ms:pand>
</wfs:member>
<wfs:member>
<ms:pand>
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545361.646442 6867889.371463</gml:lowerCorner>
<gml:upperCorner>545420.507749 6867933.162223</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:geom>
<gml:Polygon gml:id=".1" srsName="urn:ogc:def:crs:EPSG::3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">545420.507749 6867921.002773 545406.274343 6867889.371463 545396.663710 6867893.072554 545391.240546 6867895.156551 545391.082374 6867895.098126 545387.073398 6867896.667251 545386.029301 6867897.084651 545379.989239 6867899.503708 545378.314088 6867900.174137 545381.699497 6867908.453227 545361.646442 6867916.290578 545371.453024 6867931.122349 545385.250081 6867925.728791 545388.140971 6867933.162223 545391.119028 6867931.997471 545395.165705 6867930.415481 545401.939667 6867927.767008 545402.242024 6867928.506507 545410.106962 6867925.275422 545420.507749 6867921.002773 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:geom>
</ms:pand>
</wfs:member>
<wfs:member>
<ms:pand>
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857">
<gml:lowerCorner>545555.911251 6867645.996197</gml:lowerCorner>
<gml:upperCorner>545672.823313 6867762.450037</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:geom>
<gml:Polygon gml:id=".1" srsName="urn:ogc:def:crs:EPSG::3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">545589.890511 6867689.699997 545589.717149 6867689.957754 545590.512836 6867690.503892 545585.516895 6867694.971943 545579.680217 6867690.968556 545581.240247 6867688.683159 545579.120229 6867687.200583 545581.197493 6867684.079627 545581.042910 6867683.973708 545579.746923 6867685.885605 545575.743946 6867683.159664 545572.859732 6867687.417398 545567.073028 6867686.206768 545567.191221 6867685.643834 545564.695344 6867685.122310 545557.972848 6867685.737499 545555.911251 6867696.039556 545574.678444 6867699.970985 545574.989195 6867698.480173 545576.433828 6867698.783225 545582.839913 6867703.437755 545589.259969 6867704.783735 545589.794267 6867705.062639 545591.473962 6867705.414793 545596.629883 6867718.084250 545616.814319 6867733.026094 545632.110997 6867734.307151 545649.497058 6867762.450037 545672.740577 6867750.166276 545665.411006 6867735.697616 545672.823313 6867729.461109 545667.492713 6867718.940557 545668.440760 6867718.458574 545660.741748 6867703.263156 545669.619526 6867690.781410 545666.535031 6867684.653083 545655.820403 6867689.967699 545649.594803 6867683.495437 545641.948581 6867686.824814 545624.979360 6867645.996197 545594.123538 6867656.329181 545608.285703 6867688.394678 545595.780229 6867685.775465 545595.011791 6867689.464038 545593.658812 6867690.610259 545590.772818 6867690.004182 545590.635789 6867690.206466 545589.890511 6867689.699997 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:geom>
</ms:pand>
</wfs:member>
</wfs:FeatureCollection>

Binary file added testdata/rectobj/expected/wms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions testdata/rectobj/rectobj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG
ENV
MS_MAP_NO_PATH "true"
END
MAPS
MAP1 "/srv/data/ams.map"
END
END
12 changes: 12 additions & 0 deletions testdata/rectobj/rectobj.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "FeatureCollection",
"name": "pand",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::28992" } },
"features": [
{ "type": "Feature", "properties": { "fid": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 121765.886, 487262.104 ], [ 121762.745, 487256.03000000002794 ], [ 121760.341, 487251.381 ], [ 121759.056, 487248.897999999986496 ], [ 121757.54, 487245.966000000014901 ], [ 121757.213, 487245.397 ], [ 121757.046, 487245.107000000018161 ], [ 121744.986, 487251.62699999997858 ], [ 121745.928, 487253.369 ], [ 121736.999, 487258.418 ], [ 121736.857, 487258.49800000002142 ], [ 121745.18, 487273.656000000017229 ], [ 121745.206, 487273.702 ], [ 121745.74, 487273.395000000018626 ], [ 121745.6, 487273.152 ], [ 121746.433, 487272.672000000020489 ], [ 121746.573, 487272.913 ], [ 121747.04, 487272.643999999971129 ], [ 121746.901, 487272.402 ], [ 121748.579, 487271.433000000019092 ], [ 121748.719, 487271.674 ], [ 121749.187, 487271.403999999980442 ], [ 121749.047, 487271.163 ], [ 121749.879, 487270.681999999971595 ], [ 121750.019, 487270.924 ], [ 121750.557, 487270.613000000012107 ], [ 121755.595, 487267.893999999971129 ], [ 121755.571, 487267.848 ], [ 121760.912, 487264.897999999986496 ], [ 121765.908, 487262.147999999986496 ], [ 121765.886, 487262.104 ] ] ] } },
{ "type": "Feature", "properties": { "fid": 2 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 121990.461, 487372.349999999976717 ], [ 121972.977, 487353.650000000023283 ], [ 121972.198, 487352.816999999980908 ], [ 121972.135, 487352.75 ], [ 121969.018, 487352.645000000018626 ], [ 121949.422, 487370.966000000014901 ], [ 121949.361, 487370.900000000023283 ], [ 121949.171, 487371.076 ], [ 121949.229, 487371.137999999977183 ], [ 121949.262, 487371.174 ], [ 121949.181, 487371.24900000001071 ], [ 121949.348, 487371.427000000025146 ], [ 121949.392, 487371.386999999987893 ], [ 121954.156, 487376.483 ], [ 121955.428, 487376.525000000023283 ], [ 121959.113, 487373.082 ], [ 121961.398, 487375.528 ], [ 121962.67, 487375.57 ], [ 121965.018, 487373.37699999997858 ], [ 121965.089, 487373.310999999986961 ], [ 121965.138, 487371.841000000014901 ], [ 121964.966, 487371.657 ], [ 121966.69, 487370.047000000020489 ], [ 121968.188, 487371.648999999975786 ], [ 121971.706, 487371.767 ], [ 121973.343, 487370.238000000012107 ], [ 121974.953, 487371.960000000020955 ], [ 121974.738, 487372.161000000021886 ], [ 121974.688, 487373.65500000002794 ], [ 121974.758, 487373.729999999981374 ], [ 121976.944, 487376.069000000017695 ], [ 121978.216, 487376.11099999997532 ], [ 121980.688, 487373.802000000025146 ], [ 121984.154, 487377.511 ], [ 121985.426, 487377.554 ], [ 121990.669, 487372.651000000012573 ], [ 121990.605, 487372.582999999984168 ], [ 121990.695, 487372.49900000001071 ], [ 121990.512, 487372.303000000014435 ], [ 121990.461, 487372.349999999976717 ] ] ] } },
{ "type": "Feature", "properties": { "fid": 3 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 121771.806, 487293.818000000028405 ], [ 121764.094, 487278.50199999997858 ], [ 121768.22, 487276.245 ], [ 121768.672, 487277.071999999985565 ], [ 121773.641, 487274.354999999981374 ], [ 121769.37, 487265.596000000019558 ], [ 121769.32, 487265.586000000010245 ], [ 121750.67, 487275.786000000021886 ], [ 121750.64, 487275.846000000019558 ], [ 121758.586, 487290.809 ], [ 121765.61, 487304.756 ], [ 121783.921, 487295.528 ], [ 121781.156, 487289.76400000002468 ], [ 121780.898, 487289.23499999998603 ], [ 121771.806, 487293.818000000028405 ] ] ] } },
{ "type": "Feature", "properties": { "fid": 4 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 121794.367, 487390.038999999989755 ], [ 121785.53, 487370.795999999972992 ], [ 121779.666, 487373.093999999982771 ], [ 121776.357, 487374.387999999977183 ], [ 121776.26, 487374.353 ], [ 121773.814, 487375.327 ], [ 121773.177, 487375.586000000010245 ], [ 121769.492, 487377.087 ], [ 121768.47, 487377.503000000026077 ], [ 121770.575, 487382.541000000026543 ], [ 121758.34, 487387.406000000017229 ], [ 121764.4, 487396.416000000026543 ], [ 121772.818, 487393.068000000028405 ], [ 121774.617, 487397.592 ], [ 121776.434, 487396.869 ], [ 121778.903, 487395.886999999987893 ], [ 121783.036, 487394.243000000016764 ], [ 121783.224, 487394.693000000028405 ], [ 121788.022, 487392.689000000013039 ], [ 121794.367, 487390.038999999989755 ] ] ] } },
{ "type": "Feature", "properties": { "fid": 5 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 121897.038, 487248.199000000022352 ], [ 121896.933, 487248.357000000018161 ], [ 121897.422, 487248.686999999976251 ], [ 121894.384, 487251.434 ], [ 121890.797, 487249.01500000001397 ], [ 121891.742, 487247.614 ], [ 121890.439, 487246.718 ], [ 121891.697, 487244.805 ], [ 121891.602, 487244.740999999979977 ], [ 121890.817, 487245.913 ], [ 121888.357, 487244.266 ], [ 121886.61, 487246.87599999998929 ], [ 121883.065, 487246.161000000021886 ], [ 121883.135, 487245.816999999980908 ], [ 121881.606, 487245.509000000020023 ], [ 121877.496, 487245.912000000011176 ], [ 121876.277, 487252.207 ], [ 121887.774, 487254.528999999980442 ], [ 121887.958, 487253.618000000016764 ], [ 121888.843, 487253.797000000020489 ], [ 121892.781, 487256.61099999997532 ], [ 121896.714, 487257.406000000017229 ], [ 121897.042, 487257.574000000022352 ], [ 121898.071, 487257.782 ], [ 121901.277, 487265.492000000027474 ], [ 121913.686, 487274.527 ], [ 121923.049, 487275.245999999984633 ], [ 121933.8, 487292.348 ], [ 121947.969, 487284.756999999983236 ], [ 121943.426, 487275.957999999984168 ], [ 121947.935, 487272.121999999973923 ], [ 121944.631, 487265.723999999987427 ], [ 121945.209, 487265.425999999977648 ], [ 121940.437, 487256.185 ], [ 121945.817, 487248.532 ], [ 121943.905, 487244.805 ], [ 121937.372, 487248.092 ], [ 121933.537, 487244.168 ], [ 121928.873, 487246.231000000028871 ], [ 121918.325, 487221.386 ], [ 121899.491, 487227.818000000028405 ], [ 121908.286, 487247.327 ], [ 121900.625, 487245.78000000002794 ], [ 121900.17, 487248.033999999985099 ], [ 121899.347, 487248.739 ], [ 121897.579, 487248.381 ], [ 121897.496, 487248.505 ], [ 121897.038, 487248.199000000022352 ] ] ] } }
]
}
Loading
Loading