diff --git a/.gitignore b/.gitignore index 61e572d73..152f54315 100644 --- a/.gitignore +++ b/.gitignore @@ -152,3 +152,4 @@ cython_debug/ !/config/sample.config.yaml !/config/logging.yaml /tests/*/fixtures/approved/*.received.txt +/regression-tests/report/ diff --git a/CHANGELOG.md b/CHANGELOG.md index a31b14e42..7809533a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,16 @@ - report endpoint: has been deleted ([#818]) + +### Other Changes + +- a new regression test suite has been added to support safer deployments of new versions ([#820]) + + + [#818]: https://github.com/GIScience/ohsome-quality-api/pull/818 +[#820]: https://github.com/GIScience/ohsome-quality-api/issues/820 + ## Release 1.4.0 diff --git a/docs/development_setup.md b/docs/development_setup.md index 777f4ed53..c2ce75be3 100644 --- a/docs/development_setup.md +++ b/docs/development_setup.md @@ -131,6 +131,21 @@ approval tests will show the difference to the previously approved version of the output using a diff tool. If it es as expected resolve the difference using the diff-tool save and rerun the tests. +### Regression Tests + +Unlike the above-mentioned unit and integration tests, +regression tests do not primarily serve to guide and validate the development, +but to check if an upcoming version caused bugs in the existing system. + +The regression tests are implemented in `hurl` +and can be run manually on the command line against any of the staging systems. +Please consider adding new `hurl` tests if you add new endpoints. +A `hurl` plugin for JetBrains IDEs (e.g. PyCharm, Intellij Idea etc.) +is available for syntax highlighting and execution within the IDE. + +For details, check the + [regression test README](../regression-tests/README.md). + ## Logging Logging is enabled by default. diff --git a/regression-tests/README.md b/regression-tests/README.md new file mode 100644 index 000000000..f549f128f --- /dev/null +++ b/regression-tests/README.md @@ -0,0 +1,20 @@ +# Regression tests with hurl + +Hurl is an HTTP command line client and HTTP test tool: + +https://hurl.dev + +In order to run the HTTP tests in this directory, `hurl` must be installed. +The tests can be run against the different stages using the following scripts: + +* [run_hurl_tests_DEV.sh](./run_hurl_tests_DEV.sh) +* [run_hurl_tests_TEST.sh](./run_hurl_tests_TEST.sh) +* [run_hurl_tests_PROD.sh](./run_hurl_tests_PROD.sh) + +Please note that you may get different results depending on the supported endpoints and connected spatial database of the system running on a given stage. + +An HTML-report with the results is generated here: + +[report/index.html](./report/index.html) + + diff --git a/regression-tests/__run_hurl_tests_for_stage.sh b/regression-tests/__run_hurl_tests_for_stage.sh new file mode 100755 index 000000000..7ce674c91 --- /dev/null +++ b/regression-tests/__run_hurl_tests_for_stage.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# requires the env variable $HURL_BASE_URL + +rm -rf report +mkdir report + +hurl *.hurl --report-html report +printf "\n\nhurl report: file://$PWD/report/index.html\n" + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + xdg-open report/index.html +elif [[ "$OSTYPE" == "darwin"* ]]; then + open report/index.html +else + printf "\nOS could not be detected. Please open report manually!\n" +fi \ No newline at end of file diff --git a/regression-tests/buildingarea_adminarea.json b/regression-tests/buildingarea_adminarea.json new file mode 100644 index 000000000..f671639ca --- /dev/null +++ b/regression-tests/buildingarea_adminarea.json @@ -0,0 +1,264 @@ +{ + "topic": "building-area", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "admin_world_water.-1392136-_-Mechtersen", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.265479, + 53.292841 + ], + [ + 10.268466, + 53.289283 + ], + [ + 10.269601, + 53.287949 + ], + [ + 10.273601, + 53.285098 + ], + [ + 10.282639, + 53.278703 + ], + [ + 10.276988, + 53.275121 + ], + [ + 10.277516, + 53.273322 + ], + [ + 10.275928, + 53.273074 + ], + [ + 10.269857, + 53.273559 + ], + [ + 10.269889, + 53.272413 + ], + [ + 10.269892, + 53.272318 + ], + [ + 10.268551, + 53.26638 + ], + [ + 10.267856, + 53.2634 + ], + [ + 10.267252, + 53.260808 + ], + [ + 10.268023, + 53.259773 + ], + [ + 10.273413, + 53.25984 + ], + [ + 10.278369, + 53.259919 + ], + [ + 10.282533, + 53.264359 + ], + [ + 10.317224, + 53.263145 + ], + [ + 10.320234, + 53.262952 + ], + [ + 10.332321, + 53.273117 + ], + [ + 10.332535, + 53.273305 + ], + [ + 10.334421, + 53.279821 + ], + [ + 10.333494, + 53.279896 + ], + [ + 10.333618, + 53.281157 + ], + [ + 10.333542, + 53.281765 + ], + [ + 10.332881, + 53.283022 + ], + [ + 10.332489, + 53.284407 + ], + [ + 10.332515, + 53.284634 + ], + [ + 10.332286, + 53.285151 + ], + [ + 10.332067, + 53.28524 + ], + [ + 10.331666, + 53.285226 + ], + [ + 10.331364, + 53.285316 + ], + [ + 10.329092, + 53.285174 + ], + [ + 10.327606, + 53.2852 + ], + [ + 10.317079, + 53.298367 + ], + [ + 10.316994, + 53.298383 + ], + [ + 10.305875, + 53.30052 + ], + [ + 10.302164, + 53.301261 + ], + [ + 10.301776, + 53.301339 + ], + [ + 10.297672, + 53.29707 + ], + [ + 10.29316, + 53.298999 + ], + [ + 10.292739, + 53.298855 + ], + [ + 10.287022, + 53.298217 + ], + [ + 10.283959, + 53.296305 + ], + [ + 10.281243, + 53.29531 + ], + [ + 10.27852, + 53.294257 + ], + [ + 10.277945, + 53.29438 + ], + [ + 10.277808, + 53.294409 + ], + [ + 10.275742, + 53.294849 + ], + [ + 10.273617, + 53.295818 + ], + [ + 10.272054, + 53.297669 + ], + [ + 10.269823, + 53.294204 + ], + [ + 10.267451, + 53.295826 + ], + [ + 10.265479, + 53.292841 + ] + ] + ] + ] + }, + "geometry_name": "geom", + "properties": { + "id": -1392136, + "iso": null, + "name": "Mechtersen", + "name_en": null, + "local_name": "Mechtersen", + "long_name": null, + "boundary": "administrative", + "admin_level": 8, + "wikidata": "Q503766", + "wikipedia": "de:Mechtersen", + "parents": "[Ljava.lang.Integer;@4e286c37", + "parent": -1969559, + "min_scale": 1, + "max_scale": 500000 + }, + "bbox": [ + 10.265478700000036, + 53.259772999999974, + 10.334420899999964, + 53.301338699999974 + ] + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/buildingarea_adminarea_buildingcomparison.hurl b/regression-tests/buildingarea_adminarea_buildingcomparison.hurl new file mode 100644 index 000000000..162ef37fb --- /dev/null +++ b/regression-tests/buildingarea_adminarea_buildingcomparison.hurl @@ -0,0 +1,23 @@ +POST {{BASE_URL}}/indicators/building-comparison + + +accept: application/json +[Options] +verbose: true +file,buildingarea_adminarea.json; + +HTTP * + +[Asserts] +duration < 20000 +status == 200 +bytes count > 2400 + +jsonpath "$.result[0].topic.name" == "Building Area" +jsonpath "$.result[0].result.description" contains "The completeness of OSM buildings in your area-of-interest is high. The completeness in comparison to EUBUCCO is 104.27%. The completeness in comparison to Microsoft Building Footprints is 96.16%." +jsonpath "$.result[0].result.label" == "green" + + + + + diff --git a/regression-tests/buildingcount_bbox.json b/regression-tests/buildingcount_bbox.json new file mode 100644 index 000000000..504c080b5 --- /dev/null +++ b/regression-tests/buildingcount_bbox.json @@ -0,0 +1,48 @@ +{ + "topic": "building-count", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "box 1", + "bbox": [ + 8.748488, + 49.47397, + 8.7532061, + 49.4767595 + ], + "properties": { + "id": "box 1" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 8.748488, + 49.47397 + ], + [ + 8.7532061, + 49.47397 + ], + [ + 8.7532061, + 49.4767595 + ], + [ + 8.748488, + 49.4767595 + ], + [ + 8.748488, + 49.47397 + ] + ] + ] + } + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/buildingcount_bbox_attributecompleteness.hurl b/regression-tests/buildingcount_bbox_attributecompleteness.hurl new file mode 100644 index 000000000..eff591920 --- /dev/null +++ b/regression-tests/buildingcount_bbox_attributecompleteness.hurl @@ -0,0 +1,22 @@ +POST {{BASE_URL}}/indicators/attribute-completeness +accept: application/json +[Options] +verbose: true +file,buildingcount_bbox_housenumber.json; + +HTTP * + +[Asserts] +duration < 20000 +status == 200 +bytes count > 1700 + +jsonpath "$.result[0].metadata.name" == "Attribute Completeness" +jsonpath "$.result[0].topic.name" == "Building Count" +jsonpath "$.result[0].result.description" contains "The ratio of the features (all: 67.0) compared to features with expected tags (matched: 57.0) is 0.85." +jsonpath "$.result[0].result.figure.data[0].gauge.steps[0].color" == "tomato" +jsonpath "$.result[0].result.label" == "green" + + + + diff --git a/regression-tests/buildingcount_bbox_currentness.hurl b/regression-tests/buildingcount_bbox_currentness.hurl new file mode 100644 index 000000000..6686c21cc --- /dev/null +++ b/regression-tests/buildingcount_bbox_currentness.hurl @@ -0,0 +1,21 @@ +POST {{BASE_URL}}/indicators/currentness +accept: application/json +[Options] +verbose: true +file,buildingcount_bbox.json; + +HTTP * + +[Asserts] +duration < 20000 +status == 200 +bytes count > 20000 + +jsonpath "$.result[0].topic.name" == "Building Count" +jsonpath "$.result[0].result.description" contains "In the area of interest 16% of the 67 features were edited" +jsonpath "$.result[0].result.figure.data[1].marker.color" == "#21BA45" +jsonpath "$.result[0].result.label" == "red" + + + + diff --git a/regression-tests/buildingcount_bbox_housenumber.json b/regression-tests/buildingcount_bbox_housenumber.json new file mode 100644 index 000000000..d3197bd56 --- /dev/null +++ b/regression-tests/buildingcount_bbox_housenumber.json @@ -0,0 +1,49 @@ +{ + "topic": "building-count", + "attribute": "address_housenumber", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "box 1", + "bbox": [ + 8.748488, + 49.47397, + 8.7532061, + 49.4767595 + ], + "properties": { + "id": "box 1" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 8.748488, + 49.47397 + ], + [ + 8.7532061, + 49.47397 + ], + [ + 8.7532061, + 49.4767595 + ], + [ + 8.748488, + 49.4767595 + ], + [ + 8.748488, + 49.47397 + ] + ] + ] + } + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/hospitals_adminarea.json b/regression-tests/hospitals_adminarea.json new file mode 100644 index 000000000..1cf983729 --- /dev/null +++ b/regression-tests/hospitals_adminarea.json @@ -0,0 +1,264 @@ +{ + "topic": "hospitals", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "admin_world_water.-1392136-_-Mechtersen", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.265479, + 53.292841 + ], + [ + 10.268466, + 53.289283 + ], + [ + 10.269601, + 53.287949 + ], + [ + 10.273601, + 53.285098 + ], + [ + 10.282639, + 53.278703 + ], + [ + 10.276988, + 53.275121 + ], + [ + 10.277516, + 53.273322 + ], + [ + 10.275928, + 53.273074 + ], + [ + 10.269857, + 53.273559 + ], + [ + 10.269889, + 53.272413 + ], + [ + 10.269892, + 53.272318 + ], + [ + 10.268551, + 53.26638 + ], + [ + 10.267856, + 53.2634 + ], + [ + 10.267252, + 53.260808 + ], + [ + 10.268023, + 53.259773 + ], + [ + 10.273413, + 53.25984 + ], + [ + 10.278369, + 53.259919 + ], + [ + 10.282533, + 53.264359 + ], + [ + 10.317224, + 53.263145 + ], + [ + 10.320234, + 53.262952 + ], + [ + 10.332321, + 53.273117 + ], + [ + 10.332535, + 53.273305 + ], + [ + 10.334421, + 53.279821 + ], + [ + 10.333494, + 53.279896 + ], + [ + 10.333618, + 53.281157 + ], + [ + 10.333542, + 53.281765 + ], + [ + 10.332881, + 53.283022 + ], + [ + 10.332489, + 53.284407 + ], + [ + 10.332515, + 53.284634 + ], + [ + 10.332286, + 53.285151 + ], + [ + 10.332067, + 53.28524 + ], + [ + 10.331666, + 53.285226 + ], + [ + 10.331364, + 53.285316 + ], + [ + 10.329092, + 53.285174 + ], + [ + 10.327606, + 53.2852 + ], + [ + 10.317079, + 53.298367 + ], + [ + 10.316994, + 53.298383 + ], + [ + 10.305875, + 53.30052 + ], + [ + 10.302164, + 53.301261 + ], + [ + 10.301776, + 53.301339 + ], + [ + 10.297672, + 53.29707 + ], + [ + 10.29316, + 53.298999 + ], + [ + 10.292739, + 53.298855 + ], + [ + 10.287022, + 53.298217 + ], + [ + 10.283959, + 53.296305 + ], + [ + 10.281243, + 53.29531 + ], + [ + 10.27852, + 53.294257 + ], + [ + 10.277945, + 53.29438 + ], + [ + 10.277808, + 53.294409 + ], + [ + 10.275742, + 53.294849 + ], + [ + 10.273617, + 53.295818 + ], + [ + 10.272054, + 53.297669 + ], + [ + 10.269823, + 53.294204 + ], + [ + 10.267451, + 53.295826 + ], + [ + 10.265479, + 53.292841 + ] + ] + ] + ] + }, + "geometry_name": "geom", + "properties": { + "id": -1392136, + "iso": null, + "name": "Mechtersen", + "name_en": null, + "local_name": "Mechtersen", + "long_name": null, + "boundary": "administrative", + "admin_level": 8, + "wikidata": "Q503766", + "wikipedia": "de:Mechtersen", + "parents": "[Ljava.lang.Integer;@4e286c37", + "parent": -1969559, + "min_scale": 1, + "max_scale": 500000 + }, + "bbox": [ + 10.265478700000036, + 53.259772999999974, + 10.334420899999964, + 53.301338699999974 + ] + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/hospitals_adminarea_mappingsaturation__no_features.hurl b/regression-tests/hospitals_adminarea_mappingsaturation__no_features.hurl new file mode 100644 index 000000000..498e9f541 --- /dev/null +++ b/regression-tests/hospitals_adminarea_mappingsaturation__no_features.hurl @@ -0,0 +1,18 @@ +POST {{BASE_URL}}/indicators/mapping-saturation +accept: application/json +[Options] +verbose: true +file,hospitals_adminarea.json; + +HTTP * + +[Asserts] +duration < 20000 +status == 200 +bytes count > 1600 + +jsonpath "$.result[0].topic.name" == "Hospitals" +jsonpath "$.result[0].result.description" == "No features were mapped in this region." +jsonpath "$.result[0].result.figure.data[0].labels[0]" == "The creation of the Indicator was unsuccessful." + + diff --git a/regression-tests/long-running/roads_bbox.json b/regression-tests/long-running/roads_bbox.json new file mode 100644 index 000000000..f3e405d0a --- /dev/null +++ b/regression-tests/long-running/roads_bbox.json @@ -0,0 +1,48 @@ +{ + "topic": "roads", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "box 1", + "bbox": [ + 8.748488, + 49.47397, + 8.7532061, + 49.4767595 + ], + "properties": { + "id": "box 1" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 8.748488, + 49.47397 + ], + [ + 8.7532061, + 49.47397 + ], + [ + 8.7532061, + 49.4767595 + ], + [ + 8.748488, + 49.4767595 + ], + [ + 8.748488, + 49.47397 + ] + ] + ] + } + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/long-running/roads_bbox_currentness.hurl b/regression-tests/long-running/roads_bbox_currentness.hurl new file mode 100644 index 000000000..54caffbb2 --- /dev/null +++ b/regression-tests/long-running/roads_bbox_currentness.hurl @@ -0,0 +1,21 @@ +POST {{BASE_URL}}/indicators/currentness +accept: application/json +[Options] +verbose: true +file,roads_bbox.json; + +HTTP * + +[Asserts] +duration < 300000 +status == 200 +bytes count > 20000 + +jsonpath "$.result[0].topic.name" == "Roads" +jsonpath "$.result[0].result.description" contains "Please note that in the area of interest less than 25 features of the selected topic are present today." +jsonpath "$.result[0].result.figure.data[1].marker.color" == "#21BA45" +jsonpath "$.result[0].result.label" == "green" + + + + diff --git a/regression-tests/metadata.hurl b/regression-tests/metadata.hurl new file mode 100644 index 000000000..f6e0723e0 --- /dev/null +++ b/regression-tests/metadata.hurl @@ -0,0 +1,18 @@ +GET {{BASE_URL}}/metadata?project=all +accept: application/json +[Options] +verbose: true + +HTTP * + +[Asserts] +duration < 2000 +status == 200 +bytes count > 25000 + +jsonpath "$.result.indicators.mapping-saturation.description" contains "Calculate if mapping has saturated." +jsonpath "$.result.indicators.currentness.description" contains "Estimate currentness of features" +jsonpath "$.result.topics.building-count.aggregationType" == "count" +jsonpath "$.result.topics.roads.aggregationType" == "length" +jsonpath "$.result.qualityDimensions.minimal.name" == "Minimal" +jsonpath "$.result.projects.core.description" == "something that is still a TODO" diff --git a/regression-tests/roads_adminarea.json b/regression-tests/roads_adminarea.json new file mode 100644 index 000000000..6af4b33f8 --- /dev/null +++ b/regression-tests/roads_adminarea.json @@ -0,0 +1,264 @@ +{ + "topic": "roads", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "admin_world_water.-1392136-_-Mechtersen", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.265479, + 53.292841 + ], + [ + 10.268466, + 53.289283 + ], + [ + 10.269601, + 53.287949 + ], + [ + 10.273601, + 53.285098 + ], + [ + 10.282639, + 53.278703 + ], + [ + 10.276988, + 53.275121 + ], + [ + 10.277516, + 53.273322 + ], + [ + 10.275928, + 53.273074 + ], + [ + 10.269857, + 53.273559 + ], + [ + 10.269889, + 53.272413 + ], + [ + 10.269892, + 53.272318 + ], + [ + 10.268551, + 53.26638 + ], + [ + 10.267856, + 53.2634 + ], + [ + 10.267252, + 53.260808 + ], + [ + 10.268023, + 53.259773 + ], + [ + 10.273413, + 53.25984 + ], + [ + 10.278369, + 53.259919 + ], + [ + 10.282533, + 53.264359 + ], + [ + 10.317224, + 53.263145 + ], + [ + 10.320234, + 53.262952 + ], + [ + 10.332321, + 53.273117 + ], + [ + 10.332535, + 53.273305 + ], + [ + 10.334421, + 53.279821 + ], + [ + 10.333494, + 53.279896 + ], + [ + 10.333618, + 53.281157 + ], + [ + 10.333542, + 53.281765 + ], + [ + 10.332881, + 53.283022 + ], + [ + 10.332489, + 53.284407 + ], + [ + 10.332515, + 53.284634 + ], + [ + 10.332286, + 53.285151 + ], + [ + 10.332067, + 53.28524 + ], + [ + 10.331666, + 53.285226 + ], + [ + 10.331364, + 53.285316 + ], + [ + 10.329092, + 53.285174 + ], + [ + 10.327606, + 53.2852 + ], + [ + 10.317079, + 53.298367 + ], + [ + 10.316994, + 53.298383 + ], + [ + 10.305875, + 53.30052 + ], + [ + 10.302164, + 53.301261 + ], + [ + 10.301776, + 53.301339 + ], + [ + 10.297672, + 53.29707 + ], + [ + 10.29316, + 53.298999 + ], + [ + 10.292739, + 53.298855 + ], + [ + 10.287022, + 53.298217 + ], + [ + 10.283959, + 53.296305 + ], + [ + 10.281243, + 53.29531 + ], + [ + 10.27852, + 53.294257 + ], + [ + 10.277945, + 53.29438 + ], + [ + 10.277808, + 53.294409 + ], + [ + 10.275742, + 53.294849 + ], + [ + 10.273617, + 53.295818 + ], + [ + 10.272054, + 53.297669 + ], + [ + 10.269823, + 53.294204 + ], + [ + 10.267451, + 53.295826 + ], + [ + 10.265479, + 53.292841 + ] + ] + ] + ] + }, + "geometry_name": "geom", + "properties": { + "id": -1392136, + "iso": null, + "name": "Mechtersen", + "name_en": null, + "local_name": "Mechtersen", + "long_name": null, + "boundary": "administrative", + "admin_level": 8, + "wikidata": "Q503766", + "wikipedia": "de:Mechtersen", + "parents": "[Ljava.lang.Integer;@4e286c37", + "parent": -1969559, + "min_scale": 1, + "max_scale": 500000 + }, + "bbox": [ + 10.265478700000036, + 53.259772999999974, + 10.334420899999964, + 53.301338699999974 + ] + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/roads_adminarea_roadcomparison.hurl b/regression-tests/roads_adminarea_roadcomparison.hurl new file mode 100644 index 000000000..30bf00bb7 --- /dev/null +++ b/regression-tests/roads_adminarea_roadcomparison.hurl @@ -0,0 +1,22 @@ +POST {{BASE_URL}}/indicators/road-comparison +accept: application/json +[Options] +verbose: true +file,roads_adminarea.json; + +HTTP * + +[Asserts] +duration < 5000 +status == 200 +bytes count > 2200 + +jsonpath "$.result[0].topic.name" == "Roads" +jsonpath "$.result[0].result.description" contains "Microsoft Roads has a road length of 31.94 km, of which 31.82 km are covered by roads in OSM. The completeness of OSM roads in your area-of-interest is high." +jsonpath "$.result[0].result.description" matches /^Microsoft Roads has a road length of 31.\d{2} km, of which 31.\d{2} km are covered by roads in OSM. The completeness of OSM roads in your area-of-interest is high.$/ +jsonpath "$.result[0].result.label" == "green" + + + + + diff --git a/regression-tests/roads_polygon.json b/regression-tests/roads_polygon.json new file mode 100644 index 000000000..5fe6ae928 --- /dev/null +++ b/regression-tests/roads_polygon.json @@ -0,0 +1,46 @@ +{ + "topic": "roads", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "area 1", + "properties": { + "id": "area 1" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.4674621, + 5.1745498 + ], + [ + 100.4832462, + 5.1827608 + ], + [ + 100.4952558, + 5.1701022 + ], + [ + 100.4870207, + 5.1547062 + ], + [ + 100.4678053, + 5.1588118 + ], + [ + 100.4674621, + 5.1745498 + ] + ] + ] + } + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/roads_polygon_attributecompleteness.hurl b/regression-tests/roads_polygon_attributecompleteness.hurl new file mode 100644 index 000000000..01edde66f --- /dev/null +++ b/regression-tests/roads_polygon_attributecompleteness.hurl @@ -0,0 +1,22 @@ +POST {{BASE_URL}}/indicators/attribute-completeness +accept: application/json +[Options] +verbose: true +file,roads_polygon_maxspeed.json; + +HTTP * + +[Asserts] +duration < 5000 +status == 200 +bytes count > 1900 + +jsonpath "$.result[0].metadata.name" == "Attribute Completeness" +jsonpath "$.result[0].topic.name" == "Roads" +jsonpath "$.result[0].result.description" contains "The ratio of the features (all: 1034299.9) compared to features with expected tags (matched: 276785.2) is 0.27." +jsonpath "$.result[0].result.figure.data[0].gauge.steps[0].color" == "tomato" +jsonpath "$.result[0].result.label" == "yellow" + + + + diff --git a/regression-tests/roads_polygon_mappingsaturation.hurl b/regression-tests/roads_polygon_mappingsaturation.hurl new file mode 100644 index 000000000..9ca7cf5ac --- /dev/null +++ b/regression-tests/roads_polygon_mappingsaturation.hurl @@ -0,0 +1,22 @@ +POST {{BASE_URL}}/indicators/mapping-saturation +accept: application/json +[Options] +verbose: true +file,roads_polygon.json; + +HTTP * + +[Asserts] +duration < 20000 +status == 200 +bytes count > 24000 + +jsonpath "$.result[0].topic.name" == "Roads" +jsonpath "$.result[0].result.description" contains "The saturation of the last 3 years is 98.3%.High saturation has been reached (97% < Saturation ≤ 100%)." +jsonpath "$.result[0].result.figure.data[0].line.color" == "#2185D0" +jsonpath "$.result[0].result.label" == "green" + + + + + diff --git a/regression-tests/roads_polygon_maxspeed.json b/regression-tests/roads_polygon_maxspeed.json new file mode 100644 index 000000000..9a9bce412 --- /dev/null +++ b/regression-tests/roads_polygon_maxspeed.json @@ -0,0 +1,39 @@ +{ + "topic": "roads", + "attribute": "maxspeed", + "bpolys": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "area 1", + "properties": { + "id": "area 1" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 8.643064, + 49.4412261 + ], + [ + 8.6595344, + 49.3665657 + ], + [ + 8.790611, + 49.4280458 + ], + [ + 8.643064, + 49.4412261 + ] + ] + ] + } + } + ] + } +} \ No newline at end of file diff --git a/regression-tests/run_hurl_tests_DEV.sh b/regression-tests/run_hurl_tests_DEV.sh new file mode 100755 index 000000000..e925c7d92 --- /dev/null +++ b/regression-tests/run_hurl_tests_DEV.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export HURL_BASE_URL=http://127.0.0.1:8080 + +cd "$(dirname "$0")" +./__run_hurl_tests_for_stage.sh \ No newline at end of file diff --git a/regression-tests/run_hurl_tests_PROD.sh b/regression-tests/run_hurl_tests_PROD.sh new file mode 100755 index 000000000..6a96c59c3 --- /dev/null +++ b/regression-tests/run_hurl_tests_PROD.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export HURL_BASE_URL=https://api.quality.ohsome.org/v1 + +cd "$(dirname "$0")" +./__run_hurl_tests_for_stage.sh \ No newline at end of file diff --git a/regression-tests/run_hurl_tests_TEST.sh b/regression-tests/run_hurl_tests_TEST.sh new file mode 100755 index 000000000..fbca39dcf --- /dev/null +++ b/regression-tests/run_hurl_tests_TEST.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export HURL_BASE_URL=https://api.quality.ohsome.org/v1-test + +cd "$(dirname "$0")" +./__run_hurl_tests_for_stage.sh \ No newline at end of file