ansible-test - Improve runme.sh error handling (#84972)

pull/84574/merge
Matt Clay 8 months ago committed by GitHub
parent c54ff7de41
commit 3d30e05bb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Show a more user-friendly error message when a ``runme.sh`` script is not executable.

@ -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,9 @@
#!/usr/bin/env bash
source ../collection/setup.sh
set -x +o pipefail
ansible-test integration --venv --color --truncate 0 "${@}" 2>&1 | grep "Unable to run non-executable script"
echo "SUCCESS: Non-executable script error correctly handled."

@ -591,6 +591,9 @@ def command_integration_script(
"""Run an integration test script."""
display.info('Running %s integration test script' % target.name)
if not os.access(target.script_path, os.X_OK):
raise ApplicationError(f'Unable to run non-executable script {target.script_path!r}. Did you forget to run "chmod +x" on it?')
env_config = None
if isinstance(args, PosixIntegrationConfig):

Loading…
Cancel
Save