Skip to content

Commit

Permalink
Merge branch '2.9' into backport-9323-to-2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
taegyunkim authored Sep 9, 2024
2 parents a29160f + 833cc8f commit d4db6ef
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ddtrace/internal/ci_visibility/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@ def _fetch_tests_to_skip(self, skipping_mode: str):
self._test_suites_to_skip = []
self._tests_to_skip = defaultdict(list)

except Exception:
log.warning("Error retrieving skippable test data, no tests will be skipped", exc_info=True)
error_type = ERROR_TYPES.UNKNOWN
self._test_suites_to_skip = []
self._tests_to_skip = defaultdict(list)

finally:
record_itr_skippable_request(
sw.elapsed() * 1000,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
CI Visibility: This fix resolves an issue where exceptions other than timeouts and connection errors raised
while fetching the list of skippable tests for ITR were not being handled correctly and caused the tracer to
crash.
19 changes: 19 additions & 0 deletions tests/ci_visibility/test_ci_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,25 @@ def test_ci_visibility_service_skippable_timeout(_do_request, _check_enabled_fea
CIVisibility.disable()


@mock.patch(
"ddtrace.internal.ci_visibility.recorder.CIVisibility._check_enabled_features",
return_value=_CIVisibilitySettings(True, True, False, True),
)
@mock.patch("ddtrace.internal.ci_visibility.recorder._do_request", side_effect=ValueError)
def test_ci_visibility_service_skippable_other_error(_do_request, _check_enabled_features):
with override_env(
dict(
DD_API_KEY="foobar.baz",
DD_APP_KEY="foobar",
DD_CIVISIBILITY_AGENTLESS_ENABLED="1",
)
), _dummy_noop_git_client():
ddtrace.internal.ci_visibility.recorder.ddconfig = _get_default_civisibility_ddconfig()
CIVisibility.enable(service="test-service")
assert CIVisibility._instance._test_suites_to_skip == []
CIVisibility.disable()


@mock.patch("ddtrace.internal.ci_visibility.recorder._do_request")
def test_ci_visibility_service_enable_with_itr_enabled(_do_request):
with override_env(
Expand Down

0 comments on commit d4db6ef

Please sign in to comment.