mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-24 01:49:08 -07:00
Overhaul ansible-test code coverage and injector. (#53510)
This commit is contained in:
parent
3bdbe24861
commit
a8e328f474
19 changed files with 253 additions and 370 deletions
|
@ -6,6 +6,7 @@ import contextlib
|
|||
import json
|
||||
import os
|
||||
import shutil
|
||||
import stat
|
||||
import tempfile
|
||||
|
||||
from lib.target import (
|
||||
|
@ -24,6 +25,11 @@ from lib.util import (
|
|||
display,
|
||||
make_dirs,
|
||||
named_temporary_file,
|
||||
COVERAGE_CONFIG_PATH,
|
||||
COVERAGE_OUTPUT_PATH,
|
||||
MODE_DIRECTORY,
|
||||
MODE_DIRECTORY_WRITE,
|
||||
MODE_FILE,
|
||||
)
|
||||
|
||||
from lib.cache import (
|
||||
|
@ -35,6 +41,28 @@ from lib.cloud import (
|
|||
)
|
||||
|
||||
|
||||
def setup_common_temp_dir(args, path):
|
||||
"""
|
||||
:type args: IntegrationConfig
|
||||
:type path: str
|
||||
"""
|
||||
if args.explain:
|
||||
return
|
||||
|
||||
os.mkdir(path)
|
||||
os.chmod(path, MODE_DIRECTORY)
|
||||
|
||||
coverage_config_path = os.path.join(path, COVERAGE_CONFIG_PATH)
|
||||
|
||||
shutil.copy(COVERAGE_CONFIG_PATH, coverage_config_path)
|
||||
os.chmod(coverage_config_path, MODE_FILE)
|
||||
|
||||
coverage_output_path = os.path.join(path, COVERAGE_OUTPUT_PATH)
|
||||
|
||||
os.mkdir(coverage_output_path)
|
||||
os.chmod(coverage_output_path, MODE_DIRECTORY_WRITE)
|
||||
|
||||
|
||||
def generate_dependency_map(integration_targets):
|
||||
"""
|
||||
:type integration_targets: list[IntegrationTarget]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue