diff options
author | David Newswanger <gamma.dave@gmail.com> | 2017-07-07 15:37:08 -0400 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2017-07-07 12:37:08 -0700 |
commit | 294c0f91c079267acb48927663dd2bacca3d88cb (patch) | |
tree | 232354d7d03113a959a88c3bb4fb5b3f0e6db787 /test | |
parent | 3050856f2a26cad009ce8433ceafba29c5bff8e9 (diff) | |
download | ansible-294c0f91c079267acb48927663dd2bacca3d88cb.tar.gz |
added option to ansible-test to run test playbooks using the debug strategy (#26499)
Diffstat (limited to 'test')
-rw-r--r-- | test/runner/lib/config.py | 1 | ||||
-rw-r--r-- | test/runner/lib/delegation.py | 2 | ||||
-rw-r--r-- | test/runner/lib/executor.py | 3 | ||||
-rwxr-xr-x | test/runner/test.py | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/test/runner/lib/config.py b/test/runner/lib/config.py index b64288349f..1ad5739b3c 100644 --- a/test/runner/lib/config.py +++ b/test/runner/lib/config.py @@ -140,6 +140,7 @@ class IntegrationConfig(TestConfig): self.start_at_task = args.start_at_task # type: str self.allow_destructive = args.allow_destructive if 'allow_destructive' in args else False # type: bool self.retry_on_error = args.retry_on_error # type: bool + self.debug_strategy = args.debug_strategy # type: bool self.tags = args.tags self.skip_tags = args.skip_tags self.diff = args.diff diff --git a/test/runner/lib/delegation.py b/test/runner/lib/delegation.py index 81106aed86..ad914b4302 100644 --- a/test/runner/lib/delegation.py +++ b/test/runner/lib/delegation.py @@ -183,7 +183,7 @@ def delegate_docker(args, exclude, require): cmd_options = [] - if isinstance(args, ShellConfig): + if isinstance(args, ShellConfig) or (isinstance(args, IntegrationConfig) and args.debug_strategy): cmd_options.append('-it') with tempfile.NamedTemporaryFile(prefix='ansible-source-', suffix='.tgz') as local_source_fd: diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index f4b58a8cc8..0e4f2490ed 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -595,6 +595,9 @@ def integration_environment(args, target, cmd): ANSIBLE_CALLBACK_WHITELIST='junit', ) + if args.debug_strategy: + env.update(dict(ANSIBLE_STRATEGY='debug')) + env.update(integration) cloud_environment = get_cloud_environment(args, target) diff --git a/test/runner/test.py b/test/runner/test.py index f3a286810f..eeb408f2d5 100755 --- a/test/runner/test.py +++ b/test/runner/test.py @@ -216,6 +216,10 @@ def parse_args(): action='store_true', help='retry failed test with increased verbosity') + integration.add_argument('--debug-strategy', + action='store_true', + help='run test playbooks using the debug strategy') + subparsers = parser.add_subparsers(metavar='COMMAND') subparsers.required = True # work-around for python 3 bug which makes subparsers optional |