mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Refactor ansible-test config classes. (#26505)
* Move Config classes from executor.py to config.py. * Move Environment and Test config to config.py. * Move Coverage/CoverageReport Config to config.py. * Clean up type hints.
This commit is contained in:
parent
bd8ea89b1b
commit
45e377566c
10 changed files with 270 additions and 231 deletions
|
@ -13,11 +13,15 @@ from lib.target import (
|
|||
from lib.util import (
|
||||
display,
|
||||
ApplicationError,
|
||||
EnvironmentConfig,
|
||||
run_command,
|
||||
common_environment,
|
||||
)
|
||||
|
||||
from lib.config import (
|
||||
CoverageConfig,
|
||||
CoverageReportConfig,
|
||||
)
|
||||
|
||||
from lib.executor import (
|
||||
Delegate,
|
||||
install_command_requirements,
|
||||
|
@ -244,27 +248,3 @@ def get_coverage_group(args, coverage_file):
|
|||
group += '=%s' % names[part]
|
||||
|
||||
return group
|
||||
|
||||
|
||||
class CoverageConfig(EnvironmentConfig):
|
||||
"""Configuration for the coverage command."""
|
||||
def __init__(self, args):
|
||||
"""
|
||||
:type args: any
|
||||
"""
|
||||
super(CoverageConfig, self).__init__(args, 'coverage')
|
||||
|
||||
self.group_by = frozenset(args.group_by) if 'group_by' in args and args.group_by else set() # type: frozenset[str]
|
||||
self.all = args.all if 'all' in args else False # type: bool
|
||||
self.stub = args.stub if 'stub' in args else False # type: bool
|
||||
|
||||
|
||||
class CoverageReportConfig(CoverageConfig):
|
||||
"""Configuration for the coverage report command."""
|
||||
def __init__(self, args):
|
||||
"""
|
||||
:type args: any
|
||||
"""
|
||||
super(CoverageReportConfig, self).__init__(args)
|
||||
|
||||
self.show_missing = args.show_missing # type: bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue