Skip to content

Commit

Permalink
Do not use constraints when preparing venv for k8s tests on CI
Browse files Browse the repository at this point in the history
When k8s virtualenv is prepared to run k8s tests we are using
constraints, this however might lead to a problem when we increase
minimum version of an affected dependency and it conflicts with
the constraints stored in main.

Therefore in case we run tests in CI (which is indicated by
specific pull tag that we use) we do not use constraints for
installing the kubernetes venv. It should be fine, as we are
pretty much running this only as a vehicle to run tests.
  • Loading branch information
potiuk committed Jul 28, 2021
1 parent 642d05b commit e3d7e68
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/ci/kubernetes/ci_run_kubernetes_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,19 @@ function create_virtualenv() {

pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}" "wheel==${WHEEL_VERSION}"

pip install pytest freezegun \
--constraint "https://raw.githubusercontent.com/${CONSTRAINTS_GITHUB_REPOSITORY}/${DEFAULT_CONSTRAINTS_BRANCH}/constraints-${HOST_PYTHON_VERSION}.txt"
local constraints=(
--constraint
"https://raw.githubusercontent.com/${CONSTRAINTS_GITHUB_REPOSITORY}/${DEFAULT_CONSTRAINTS_BRANCH}/constraints-${HOST_PYTHON_VERSION}.txt"
)
if [[ -n ${GITHUB_REGISTRY_PULL_IMAGE_TAG=} ]]; then
# Disable constraints when building in CI with specific version of sources
# In case there will be conflicting constraints
constraints=()
fi

pip install pytest freezegun "${constraints[@]}"

pip install -e ".[cncf.kubernetes,postgres]" \
--constraint "https://raw.githubusercontent.com/${CONSTRAINTS_GITHUB_REPOSITORY}/${DEFAULT_CONSTRAINTS_BRANCH}/constraints-${HOST_PYTHON_VERSION}.txt"
pip install -e ".[cncf.kubernetes,postgres]" "${constraints[@]}"
}

function run_tests() {
Expand Down

0 comments on commit e3d7e68

Please sign in to comment.