Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci_visibility): override API answer if _DD_CIVISIBILITY_ITR_FORCE_ENABLE_COVERAGE is set #7656

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ddtrace/internal/ci_visibility/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def __init__(self, tracer=None, config=None, service=None):

@staticmethod
def _should_collect_coverage(coverage_enabled_by_api):
if not coverage_enabled_by_api:
if not coverage_enabled_by_api and not asbool(
os.getenv("_DD_CIVISIBILITY_ITR_FORCE_ENABLE_COVERAGE", default=False)
):
return False
if compat.PY2:
log.warning("CI Visibility code coverage tracking is enabled, but Python 2 is not supported.")
Expand Down Expand Up @@ -240,8 +242,6 @@ def _check_enabled_features(self):
return False, False

attributes = parsed["data"]["attributes"]
if asbool(os.getenv("_DD_CIVISIBILITY_ITR_FORCE_ENABLE_COVERAGE", default=False)):
return True, attributes["tests_skipping"]
return attributes["code_coverage"], attributes["tests_skipping"]

def _configure_writer(self, coverage_enabled=False, requests_mode=None):
Expand Down
Loading