mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 12:19:53 +01:00
ansible-test - Improve runme.sh error handling (#84972)
This commit is contained in:
parent
c54ff7de41
commit
3d30e05bb4
2
changelogs/fragments/ansible-test-no-exec-script.yml
Normal file
2
changelogs/fragments/ansible-test-no-exec-script.yml
Normal file
|
|
@ -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 @@
|
|||
context/controller
|
||||
|
|
@ -0,0 +1 @@
|
|||
# shellcheck shell=bash
|
||||
|
|
@ -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…
Reference in New Issue
Block a user