summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal/commands/integration/coverage.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/ansible_test/_internal/commands/integration/coverage.py')
-rw-r--r--test/lib/ansible_test/_internal/commands/integration/coverage.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/lib/ansible_test/_internal/commands/integration/coverage.py b/test/lib/ansible_test/_internal/commands/integration/coverage.py
index c36b440366..dd885c30f9 100644
--- a/test/lib/ansible_test/_internal/commands/integration/coverage.py
+++ b/test/lib/ansible_test/_internal/commands/integration/coverage.py
@@ -33,6 +33,7 @@ from ...util import (
get_type_map,
remove_tree,
sanitize_host_name,
+ verified_chmod,
)
from ...util_common import (
@@ -118,7 +119,7 @@ class CoverageHandler(t.Generic[THostConfig], metaclass=abc.ABCMeta):
def run_playbook(self, playbook, variables): # type: (str, t.Dict[str, str]) -> None
"""Run the specified playbook using the current inventory."""
self.create_inventory()
- run_playbook(self.args, self.inventory_path, playbook, variables)
+ run_playbook(self.args, self.inventory_path, playbook, capture=False, variables=variables)
class PosixCoverageHandler(CoverageHandler[PosixConfig]):
@@ -166,9 +167,9 @@ class PosixCoverageHandler(CoverageHandler[PosixConfig]):
write_text_file(coverage_config_path, coverage_config, create_directories=True)
- os.chmod(coverage_config_path, MODE_FILE)
+ verified_chmod(coverage_config_path, MODE_FILE)
os.mkdir(coverage_output_path)
- os.chmod(coverage_output_path, MODE_DIRECTORY_WRITE)
+ verified_chmod(coverage_output_path, MODE_DIRECTORY_WRITE)
def setup_target(self):
"""Perform setup for code coverage on the target."""
@@ -271,7 +272,7 @@ class WindowsCoverageHandler(CoverageHandler[WindowsConfig]):
@property
def is_active(self): # type: () -> bool
"""True if the handler should be used, otherwise False."""
- return self.profiles and not self.args.coverage_check
+ return bool(self.profiles) and not self.args.coverage_check
def setup(self): # type: () -> None
"""Perform setup for code coverage."""