mirror of https://github.com/ansible/ansible.git
ansible-test - Always use managed entry points (#81537)
parent
a48feb4cfc
commit
390e508d27
@ -0,0 +1,3 @@
|
|||||||
|
bugfixes:
|
||||||
|
- ansible-test - Always use ansible-test managed entry points for ansible-core CLI tools when not running from source.
|
||||||
|
This fixes issues where CLI entry points created during install are not compatible with ansible-test.
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1 @@
|
|||||||
|
context/controller
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# This test ensures that the bin entry points created by ansible-test work
|
||||||
|
# when ansible-test is running from an install instead of from source.
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# The third PATH entry is the injected bin directory created by ansible-test.
|
||||||
|
bin_dir="$(python -c 'import os; print(os.environ["PATH"].split(":")[2])')"
|
||||||
|
|
||||||
|
while IFS= read -r name
|
||||||
|
do
|
||||||
|
bin="${bin_dir}/${name}"
|
||||||
|
|
||||||
|
entry_point="${name//ansible-/}"
|
||||||
|
entry_point="${entry_point//ansible/adhoc}"
|
||||||
|
|
||||||
|
echo "=== ${name} (${entry_point})=${bin} ==="
|
||||||
|
|
||||||
|
if [ "${name}" == "ansible-test" ]; then
|
||||||
|
echo "skipped - ansible-test does not support self-testing from an install"
|
||||||
|
else
|
||||||
|
"${bin}" --version | tee /dev/stderr | grep -Eo "(^${name}\ \[core\ .*|executable location = ${bin}$)"
|
||||||
|
fi
|
||||||
|
done < entry-points.txt
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
base_dir="$(dirname "$(dirname "$(dirname "$(dirname "${OUTPUT_DIR}")")")")"
|
||||||
|
bin_dir="${base_dir}/bin"
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
source virtualenv.sh
|
||||||
|
|
||||||
|
unset PYTHONPATH
|
||||||
|
|
||||||
|
# find the bin entry points to test
|
||||||
|
ls "${bin_dir}" > tests/integration/targets/installed/entry-points.txt
|
||||||
|
|
||||||
|
# deps are already installed, using --no-deps to avoid re-installing them
|
||||||
|
pip install "${base_dir}" --disable-pip-version-check --no-deps
|
||||||
|
|
||||||
|
# verify entry point generation without delegation
|
||||||
|
ansible-test integration --color --truncate 0 "${@}"
|
||||||
|
|
||||||
|
# verify entry point generation with same-host delegation
|
||||||
|
ansible-test integration --venv --color --truncate 0 "${@}"
|
||||||
Loading…
Reference in New Issue