-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Standardize e2e tests * Ensure dss and monitoring images are current * Fix container name in local log collection
- Loading branch information
1 parent
72b8b27
commit 37fbff5
Showing
12 changed files
with
190 additions
and
243 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
OAUTH_CONTAINER="dss_sandbox_local-dss-dummy-oauth_1" | ||
CORE_SERVICE_CONTAINER="dss_sandbox_local-dss-core-service_1" | ||
declare -a localhost_containers=("$OAUTH_CONTAINER" "$CORE_SERVICE_CONTAINER") | ||
|
||
for container_name in "${localhost_containers[@]}"; do | ||
last_message="" | ||
while true; do | ||
if [ "$( docker container inspect -f '{{.State.Status}}' "${container_name}" 2>/dev/null)" = "running" ]; then | ||
break | ||
fi | ||
new_message="Waiting for ${container_name} container to start..." | ||
if [ "${new_message}" = "${last_message}" ]; then | ||
printf "." | ||
else | ||
printf '..%s..' "${new_message}" | ||
last_message="${new_message}" | ||
fi | ||
sleep 3 | ||
done | ||
if [ -n "${last_message}" ]; then | ||
echo "" | ||
fi | ||
done | ||
|
||
last_message="" | ||
while true; do | ||
health_status="$( docker container inspect -f '{{.State.Health.Status}}' "${CORE_SERVICE_CONTAINER}" )" | ||
if [ "${health_status}" = "healthy" ]; then | ||
break | ||
else | ||
new_message="Waiting for ${CORE_SERVICE_CONTAINER} to be available (currently ${health_status})..." | ||
if [ "${new_message}" = "${last_message}" ]; then | ||
printf "." | ||
else | ||
printf '..%s..' "${new_message}" | ||
last_message="${new_message}" | ||
fi | ||
sleep 3 | ||
fi | ||
done | ||
if [ -n "${last_message}" ]; then | ||
echo "" | ||
fi | ||
|
||
echo "Local DSS instance is now available." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
set -x | ||
|
||
# Find and change to repo root directory | ||
OS=$(uname) | ||
if [[ "$OS" == "Darwin" ]]; then | ||
# OSX uses BSD readlink | ||
BASEDIR="$(dirname "$0")" | ||
else | ||
BASEDIR=$(readlink -e "$(dirname "$0")") | ||
fi | ||
cd "${BASEDIR}/../.." || exit 1 | ||
|
||
CORE_SERVICE_CONTAINER="dss_sandbox_local-dss-core-service_1" | ||
OAUTH_CONTAINER="dss_sandbox_local-dss-dummy-oauth_1" | ||
declare -a localhost_containers=("$CORE_SERVICE_CONTAINER" "$OAUTH_CONTAINER") | ||
|
||
for container_name in "${localhost_containers[@]}"; do | ||
if [ "$( docker container inspect -f '{{.State.Status}}' "$container_name" )" == "running" ]; then | ||
echo "$container_name available!" | ||
else | ||
echo '#########################################################################' | ||
echo '## Prerequisite to run this command is: ##' | ||
echo '## Local DSS instance + Dummy OAuth server (/build/dev/run_locally.sh) ##' | ||
echo '#########################################################################' | ||
echo "Error: $container_name not running. Execute 'build/dev/run_locally.sh up' before running monitoring/prober/run_locally.sh"; | ||
exit 1; | ||
fi | ||
done | ||
|
||
echo "Re/Create e2e_test_result file" | ||
RESULTFILE="$(pwd)/e2e_test_result" | ||
touch "${RESULTFILE}" | ||
cat /dev/null > "${RESULTFILE}" | ||
|
||
if ! docker run --link "$OAUTH_CONTAINER":oauth \ | ||
--link "$CORE_SERVICE_CONTAINER":core-service \ | ||
--network dss_sandbox_default \ | ||
-v "${RESULTFILE}:/app/test_result" \ | ||
-w /app/monitoring/prober \ | ||
interuss/monitoring \ | ||
pytest \ | ||
"${1:-.}" \ | ||
-rsx \ | ||
--junitxml=/app/test_result \ | ||
--dss-endpoint http://core-service:8082 \ | ||
--rid-auth "DummyOAuth(http://oauth:8085/token,sub=fake_uss)" \ | ||
--rid-v2-auth "DummyOAuth(http://oauth:8085/token,sub=fake_uss)" \ | ||
--scd-auth1 "DummyOAuth(http://oauth:8085/token,sub=fake_uss)" \ | ||
--scd-auth2 "DummyOAuth(http://oauth:8085/token,sub=fake_uss2)" \ | ||
--scd-api-version 1.0.0; then | ||
|
||
if [ "$CI" == "true" ]; then | ||
echo "=== END OF TEST RESULTS ===" | ||
echo "Dumping core-service logs" | ||
docker logs "$CORE_SERVICE_CONTAINER" | ||
fi | ||
fi |
Oops, something went wrong.