mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-18 14:21:06 -07:00
Add --list-targets and speed up --explain. (#26838)
* Add ansible-test --list-targets option. * Speed up ansible-test integration --explain.
This commit is contained in:
parent
5c8e19d630
commit
27033915cc
5 changed files with 44 additions and 20 deletions
|
@ -34,6 +34,7 @@ from lib.executor import (
|
|||
)
|
||||
|
||||
from lib.config import (
|
||||
IntegrationConfig,
|
||||
PosixIntegrationConfig,
|
||||
WindowsIntegrationConfig,
|
||||
NetworkIntegrationConfig,
|
||||
|
@ -81,7 +82,7 @@ def main():
|
|||
config = args.config(args)
|
||||
display.verbosity = config.verbosity
|
||||
display.color = config.color
|
||||
display.info_stderr = isinstance(config, SanityConfig) and config.lint
|
||||
display.info_stderr = (isinstance(config, SanityConfig) and config.lint) or (isinstance(config, IntegrationConfig) and config.list_targets)
|
||||
check_startup()
|
||||
|
||||
try:
|
||||
|
@ -229,6 +230,10 @@ def parse_args():
|
|||
default='all',
|
||||
help='target to run when all tests are needed')
|
||||
|
||||
integration.add_argument('--list-targets',
|
||||
action='store_true',
|
||||
help='list matching targets instead of running tests')
|
||||
|
||||
subparsers = parser.add_subparsers(metavar='COMMAND')
|
||||
subparsers.required = True # work-around for python 3 bug which makes subparsers optional
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue