issue #587: support pausing ansible_tests if flag file exists
To support debugging on Azure
This commit is contained in:
parent
8a18d1862e
commit
838742f000
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import ci_lib
|
import ci_lib
|
||||||
|
@ -13,6 +14,12 @@ TESTS_DIR = os.path.join(ci_lib.GIT_ROOT, 'tests/ansible')
|
||||||
HOSTS_DIR = os.path.join(ci_lib.TMP, 'hosts')
|
HOSTS_DIR = os.path.join(ci_lib.TMP, 'hosts')
|
||||||
|
|
||||||
|
|
||||||
|
def pause_if_interactive():
|
||||||
|
if os.path.exists('/tmp/interactive'):
|
||||||
|
while True:
|
||||||
|
signal.pause()
|
||||||
|
|
||||||
|
|
||||||
with ci_lib.Fold('unit_tests'):
|
with ci_lib.Fold('unit_tests'):
|
||||||
os.environ['SKIP_MITOGEN'] = '1'
|
os.environ['SKIP_MITOGEN'] = '1'
|
||||||
ci_lib.run('./run_tests -v')
|
ci_lib.run('./run_tests -v')
|
||||||
|
@ -59,5 +66,11 @@ with ci_lib.Fold('job_setup'):
|
||||||
|
|
||||||
with ci_lib.Fold('ansible'):
|
with ci_lib.Fold('ansible'):
|
||||||
playbook = os.environ.get('PLAYBOOK', 'all.yml')
|
playbook = os.environ.get('PLAYBOOK', 'all.yml')
|
||||||
|
try:
|
||||||
run('./run_ansible_playbook.py %s -i "%s" %s',
|
run('./run_ansible_playbook.py %s -i "%s" %s',
|
||||||
playbook, HOSTS_DIR, ' '.join(sys.argv[1:]))
|
playbook, HOSTS_DIR, ' '.join(sys.argv[1:]))
|
||||||
|
except:
|
||||||
|
pause_if_interactive()
|
||||||
|
raise
|
||||||
|
|
||||||
|
pause_if_interactive()
|
||||||
|
|
Loading…
Reference in New Issue