Add prepare_e2e.sh (#7279)

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/7292/head
quicksilver 2021-08-25 14:11:52 +08:00 committed by GitHub
parent 8aa13f96f1
commit b12eec8c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 7 deletions

View File

@ -302,10 +302,11 @@ if [[ -z "${SKIP_INSTALL:-}" ]]; then
fi
if [[ -z "${SKIP_TEST:-}" ]]; then
trace "prepare e2e test" "${ROOT}/tests/scripts/prepare_e2e.sh"
if [[ -n "${TEST_TIMEOUT:-}" ]]; then
trace "test" "timeout" "-v" "${TEST_TIMEOUT}" "${ROOT}/tests/scripts/e2e.sh" "${TEST_EXTRA_ARG}"
trace "e2e test" "timeout" "-v" "${TEST_TIMEOUT}" "${ROOT}/tests/scripts/e2e.sh" "${TEST_EXTRA_ARG}"
else
trace "test" "${ROOT}/tests/scripts/e2e.sh" "${TEST_EXTRA_ARG}"
trace "e2e test" "${ROOT}/tests/scripts/e2e.sh" "${TEST_EXTRA_ARG}"
fi
fi

View File

@ -54,11 +54,6 @@ if [[ "${TEST_ENV:-}" =~ ^kind* ]]; then
fi
pushd "${ROOT}/tests/docker"
docker-compose pull --ignore-pull-failures pytest
if [[ -z "${SKIP_CHECK_PYTEST_ENV:-}" ]]; then
docker-compose build pytest
fi
if [[ "${TEST_ENV:-}" =~ ^kind* ]]; then
export PRE_EXIST_NETWORK="true"
export PYTEST_NETWORK="kind"

30
tests/scripts/prepare_e2e.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
set -e
set -x
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
pushd "${ROOT}/tests/docker"
docker-compose pull --ignore-pull-failures pytest
if [[ -z "${SKIP_CHECK_PYTEST_ENV:-}" ]]; then
docker-compose build pytest
fi
popd