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 6442ec9
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 with Docker SDK, urllib3, requests from sources
test: rhel/9.3-dev-latest
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:
- git+https://github.com/psf/requests
- git+https://github.com/urllib3/urllib3
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 @@ -31,9 +31,22 @@

- name: Install/upgrade Python requirements
pip:
name: "{{ [docker_pip_package ~ docker_pip_package_limit] + docker_pip_extra_packages }}"
name: >-
{{
(
['git+https://github.com/docker/docker-py']
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 6442ec9

Please sign in to comment.