Skip to content

Commit

Permalink
Run some tests with the latest development versions of Docker SDK for…
Browse files Browse the repository at this point in the history
… Python, requests, and urllib3.
  • Loading branch information
felixfontein committed Jun 29, 2024
1 parent 165571f commit dc0a0af
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ stages:
parameters:
testFormat: devel/{0}
targets:
- name: RHEL 9.4 with latest Docker SDK from PyPi
test: rhel/9.4-pypi-latest
- name: RHEL 9.4 with Docker SDK, urllib3, requests from sources
test: rhel/9.4-dev-latest
groups:
- 1
- 2
Expand All @@ -222,8 +222,8 @@ stages:
parameters:
testFormat: 2.17/{0}
targets:
- name: RHEL 9.3 with latest Docker SDK from PyPi
test: rhel/9.3-pypi-latest
- name: RHEL 9.3
test: rhel/9.3
groups:
- 1
- 2
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/targets/setup_docker_python_deps/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@
name: "{{ docker_pip_api_packages + (docker_pip_api_packages_python2 if ansible_facts.python.version.major == 2 else []) }}"
extra_args: "-c {{ remote_constraints }}"
state: present
when: not (force_docker_sdk_for_python_dev | default(false))

- name: Install/upgrade Python requirements from source repositories
pip:
name:
- https://github.com/psf/requests/archive/main.tar.gz
- https://github.com/urllib3/urllib3/archive/main.tar.gz
extra_args: "-c {{ remote_constraints }}"
state: latest
when: (force_docker_sdk_for_python_dev | default(false))
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ docker_py_version: '0.0'
docker_pip_extra_packages: []
docker_pip_package: docker
docker_pip_package_limit: ''

docker_pip_git_packages:
- https://github.com/psf/requests/archive/main.tar.gz
- https://github.com/urllib3/urllib3/archive/main.tar.gz
- https://github.com/docker/docker-py/archive/main.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@

- name: Install/upgrade Python requirements
pip:
name: "{{ [docker_pip_package ~ docker_pip_package_limit] + docker_pip_extra_packages }}"
name: >-
{{
docker_pip_git_packages
if (force_docker_sdk_for_python_dev | default(false)) else
([docker_pip_package ~ docker_pip_package_limit] + docker_pip_extra_packages)
}}
extra_args: "-c {{ remote_constraints }}"
state: "{{ 'latest' if force_docker_sdk_for_python_pypi | default(false) else 'present' }}"
state: >-
{{
'latest' if (
(force_docker_sdk_for_python_pypi | default(false)) or
(force_docker_sdk_for_python_dev | default(false))
) else 'present'
}}
- name: Check docker-py version
command: "{{ ansible_python.executable }} -c 'import docker; print(docker.__version__)'"
Expand Down
9 changes: 9 additions & 0 deletions tests/utils/shippable/linux-community.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ else
target="azp/"
fi

if [[ "${python}" =~ -pypi-latest$ ]]; then
python="${python/-pypi-latest}"
echo 'force_docker_sdk_for_python_pypi: true' >> tests/integration/integration_config.yml
fi
if [[ "${python}" =~ -dev-latest$ ]]; then
python="${python/-dev-latest}"
echo 'force_docker_sdk_for_python_dev: true' >> tests/integration/integration_config.yml
fi

# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--docker "quay.io/ansible-community/test-image:${image}" --python "${python}"
9 changes: 9 additions & 0 deletions tests/utils/shippable/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ else
target="azp/"
fi

if [[ "${image}" =~ -pypi-latest$ ]]; then
image="${image/-pypi-latest}"
echo 'force_docker_sdk_for_python_pypi: true' >> tests/integration/integration_config.yml
fi
if [[ "${image}" =~ -dev-latest$ ]]; then
image="${image/-dev-latest}"
echo 'force_docker_sdk_for_python_dev: true' >> tests/integration/integration_config.yml
fi

# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--docker "${image}"
9 changes: 6 additions & 3 deletions tests/utils/shippable/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ else
target="azp/"
fi

force_python=""
if [[ "${version}" =~ -pypi-latest$ ]]; then
version="${version/-pypi-latest}"
echo 'force_docker_sdk_for_python_pypi: true' >> tests/integration/interation_config.yml
echo 'force_docker_sdk_for_python_pypi: true' >> tests/integration/integration_config.yml
fi
if [[ "${version}" =~ -dev-latest$ ]]; then
version="${version/-dev-latest}"
echo 'force_docker_sdk_for_python_dev: true' >> tests/integration/integration_config.yml
fi

stage="${S:-prod}"
Expand All @@ -42,4 +45,4 @@ fi

# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--python "${pyver}" --remote "${platform}/${version}" --remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}" ${force_python}
--python "${pyver}" --remote "${platform}/${version}" --remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}"

0 comments on commit dc0a0af

Please sign in to comment.