-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: evaluate profile_default (#1767)
- Loading branch information
Showing
20 changed files
with
219 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
.integration-scenarios/debian-12-jar-mvn/tests/ors-config-location-to-nonexisting-file.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
TESTROOT="$( cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P )" | ||
source $TESTROOT/files/testfunctions.sh | ||
source $TESTROOT/files/test.conf | ||
prepareTest $(basename $0) $* | ||
|
||
configCar=$(makeTempFile $(basename $0) "\ | ||
ors: | ||
engine: | ||
source_file: ors-api/src/test/files/heidelberg.osm.gz | ||
profiles: | ||
car: | ||
enabled: true") | ||
|
||
# The profile configured as run argument should be preferred over environment variable. | ||
# The default yml file should not be used when ORS_CONFIG_LOCATION is set, | ||
# even if the file does not exist. Fallback to default ors-config.yml is not desired! | ||
podman run --replace --name "${CONTAINER}" -p "${HOST_PORT}":8082 \ | ||
-v "${M2_FOLDER}":/root/.m2 \ | ||
-v "${TESTROOT}/graphs_volume":"${CONTAINER_WORK_DIR}/graphs" \ | ||
-v "${configCar}":${CONTAINER_WORK_DIR}/ors-config.yml \ | ||
--env ORS_CONFIG_LOCATION=${CONTAINER_WORK_DIR}/nonexisting.yml \ | ||
"local/${IMAGE}:latest" \ | ||
$(getProgramArguments ${runType} ${CONTAINER_WORK_DIR}/config-car.yml) & | ||
|
||
|
||
# expect process finished timout | ||
res=$(expectOrsStartupFails 60 "$CONTAINER" ) | ||
# stop container if was not finished | ||
cleanupTest | ||
|
||
assertEquals "terminated" "$res" |
30 changes: 30 additions & 0 deletions
30
.integration-scenarios/debian-12-jar-mvn/tests/profile-default-enabled-false.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
TESTROOT="$( cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P )" | ||
source $TESTROOT/files/testfunctions.sh | ||
source $TESTROOT/files/test.conf | ||
prepareTest $(basename $0) $* | ||
|
||
configPT=$(makeTempFile $(basename $0) "\ | ||
ors: | ||
engine: | ||
source_file: ors-api/src/test/files/heidelberg.osm.gz | ||
profile_default: | ||
enabled: false | ||
profiles: | ||
public-transport: | ||
gtfs_file: ors-api/src/test/files/vrn_gtfs_cut.zip | ||
") | ||
|
||
# When profiles are not enabled as default and none is explicitly enabled, | ||
# then ORS should not start up | ||
podman run --replace --name "${CONTAINER}" -p "${HOST_PORT}":8082 \ | ||
-v "${M2_FOLDER}":/root/.m2 \ | ||
-v "${TESTROOT}/graphs_volume":"${CONTAINER_WORK_DIR}/graphs" \ | ||
-v "${configPT}":"${CONTAINER_WORK_DIR}/ors-config.yml" \ | ||
"local/${IMAGE}:latest" & | ||
|
||
res=$(expectOrsStartupFails 300 "$CONTAINER" ) | ||
cleanupTest | ||
|
||
assertEquals "terminated" "$res" |
31 changes: 31 additions & 0 deletions
31
.integration-scenarios/debian-12-jar-mvn/tests/profile-default-enabled-true.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
TESTROOT="$( cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P )" | ||
source $TESTROOT/files/testfunctions.sh | ||
source $TESTROOT/files/test.conf | ||
prepareTest $(basename $0) $* | ||
|
||
configPT=$(makeTempFile $(basename $0) "\ | ||
ors: | ||
engine: | ||
source_file: ors-api/src/test/files/heidelberg.osm.gz | ||
profile_default: | ||
enabled: true | ||
profiles: | ||
public-transport: | ||
gtfs_file: ors-api/src/test/files/vrn_gtfs_cut.zip | ||
") | ||
|
||
# When profile_default.enabled: true | ||
# then all profiles should be enabled | ||
podman run --replace --name "${CONTAINER}" -p "${HOST_PORT}":8082 \ | ||
-v "${M2_FOLDER}":/root/.m2 \ | ||
-v "${TESTROOT}/graphs_volume":"${CONTAINER_WORK_DIR}/graphs" \ | ||
-v "${configPT}":"${CONTAINER_WORK_DIR}/ors-config.yml" \ | ||
"local/${IMAGE}:latest" & | ||
|
||
awaitOrsReady 300 "${HOST_PORT}" | ||
profiles=$(requestEnabledProfiles ${HOST_PORT}) | ||
cleanupTest | ||
|
||
assertSortedWordsEquals "foot-walking wheelchair foot-hiking public-transport cycling-electric cycling-mountain driving-car driving-hgv cycling-regular cycling-road" "${profiles}" |
36 changes: 36 additions & 0 deletions
36
.integration-scenarios/debian-12-jar-mvn/tests/profile-default-maximum-properties.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
TESTROOT="$( cd "$(dirname "$0")"/.. >/dev/null 2>&1 ; pwd -P )" | ||
source $TESTROOT/files/testfunctions.sh | ||
source $TESTROOT/files/test.conf | ||
prepareTest $(basename $0) $* | ||
|
||
configPT=$(makeTempFile $(basename $0) "\ | ||
ors: | ||
engine: | ||
source_file: ors-api/src/test/files/heidelberg.osm.gz | ||
profile_default: | ||
maximum_distance: 111111 | ||
maximum_distance_dynamic_weights: 111111 | ||
maximum_distance_avoid_areas: 111111 | ||
maximum_waypoints: 11 | ||
profiles: | ||
car: | ||
enabled: true | ||
maximum_waypoints: 55 | ||
") | ||
|
||
podman run --replace --name "${CONTAINER}" -p "${HOST_PORT}":8082 \ | ||
-v "${M2_FOLDER}":/root/.m2 \ | ||
-v "${TESTROOT}/graphs_volume":"${CONTAINER_WORK_DIR}/graphs" \ | ||
-v "${configPT}":"${CONTAINER_WORK_DIR}/ors-config.yml" \ | ||
"local/${IMAGE}:latest" & | ||
|
||
awaitOrsReady 300 "${HOST_PORT}" | ||
statusString=$(requestStatusString ${HOST_PORT}) | ||
cleanupTest | ||
|
||
assertEquals "111111" "$(echo $statusString | jq -r '.profiles."profile 1".limits.maximum_distance')" "maximum_distance" | ||
assertEquals "55" "$(echo $statusString | jq -r '.profiles."profile 1".limits.maximum_waypoints')" "maximum_waypoints" | ||
assertEquals "111111" "$(echo $statusString | jq -r '.profiles."profile 1".limits.maximum_distance_dynamic_weights')" "maximum_distance_dynamic_weights" | ||
assertEquals "111111" "$(echo $statusString | jq -r '.profiles."profile 1".limits.maximum_distance_avoid_areas')" "maximum_distance_avoid_areas" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.