Merge pull request #525 from sclorg/use_internal_openshift_registry

Use internal openshift registry
This commit is contained in:
phracek 2022-06-14 09:37:22 +00:00
commit 3e1d82ec39
12 changed files with 471 additions and 242 deletions

View file

@ -8,6 +8,13 @@
#
declare -a WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,django-different-port,standalone,setup,setup-cfg,setup-requirements,django,numpy,app-home,npm-virtualenv-uwsgi,locale,mod-wsgi,pipenv,pipenv-and-micropipenv-should-fail,pin-pipenv-version,app-module,micropipenv,micropipenv-requirements}-test-app)
# Some tests, like the one using the latest pipenv, might be unstable
# because new upstream releases tend to break our tests sometimes.
# If a test is in UNSTABLE_TESTS and IGNORE_UNSTABLE_TESTS env
# variable is defined, a result of the test has no impact on
# the overall result of the test suite.
declare -a UNSTABLE_TESTS=(pipenv-test-app)
# TODO: Make command compatible for Mac users
test_dir="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"
image_dir=$(readlink -f ${test_dir}/..)
@ -37,6 +44,8 @@ IMAGE_NAME=${IMAGE_NAME:-centos/python-${VERSION//./}-centos7}
. test/test-lib.sh
ct_enable_cleanup
info() {
echo -e "\n\e[1m[INFO] $@\e[0m\n"
}
@ -245,9 +254,7 @@ test_application_enable_init_wrapper() {
test_scl_variables_in_dockerfile() {
if [ "$OS" == "rhel7" ] || [ "$OS" == "centos7" ]; then
TESTCASE_RESULT=0
# autocleanup only enabled here as only the following tests so far use it
CID_FILE_DIR=$(mktemp -d)
ct_enable_cleanup
info "Testing variable presence during \`docker exec\`"
ct_check_exec_env_vars
@ -259,28 +266,6 @@ test_scl_variables_in_dockerfile() {
fi
}
function run_all_tests() {
local APP_NAME=${1:-undefined}
for test_case in $TEST_SET; do
info "Running test $test_case ... "
TESTCASE_RESULT=0
$test_case
local test_msg
if [ $TESTCASE_RESULT -eq 0 ]; then
test_msg="[PASSED]"
else
test_msg="[FAILED]"
TESTSUITE_RESULT=1
fi
test "$APP_NAME" == "undefined" && msg_app="" || msg_app="'$APP_NAME'"
printf -v test_short_summary "%s %s for %s %s\n" "${test_short_summary}" "${test_msg}" "${msg_app}" "$test_case"
[ -n "${FAIL_QUICKLY:-}" ] && {
cleanup "${APP_NAME}"
return 1
}
done;
}
# For debugging purposes, this script can be run with one or more arguments
# those arguments list is a sub-set of values in the WEB_APPS array defined above
# Example: ./run app-home-test-app pipenv-test-app
@ -312,19 +297,10 @@ for app in ${@:-${WEB_APPS[@]}}; do
printf -v test_short_summary "%s %s for %s\n" "${test_short_summary}" "$test_msg" "$msg_run_s2i_build"
fi
echo ""
TEST_SET=${TESTS:-$TEST_LIST} run_all_tests "${app}"
TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "${app}"
cleanup ${app}
done
TEST_SET=${TESTS:-$TEST_VAR_DOCKER} run_all_tests
TEST_SET=${TESTS:-$TEST_VAR_DOCKER} ct_run_tests_from_testset "var-docker"
echo "$test_short_summary"
if [ $TESTSUITE_RESULT -eq 0 ] ; then
echo "Tests for ${IMAGE_NAME} succeeded."
else
echo "Tests for ${IMAGE_NAME} failed."
fi
exit $TESTSUITE_RESULT