Skip to content

Commit 19ca222

Browse files
committed
chore(ci-insights): Remove support for MERGIFY_TEST_FLAKY_DETECTION variable
The goal of this change is to stop supporting this variable because we want to dynamically set span attributes with our clients (`pytest-mergify`) instead. References: MRGFY-6218 Change-Id: I2039ca71b2509eada298ccb67032c55512981b44
1 parent 747e19e commit 19ca222

File tree

4 files changed

+0
-37
lines changed

4 files changed

+0
-37
lines changed

mergify_cli/ci/detector.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,3 @@ def get_github_repository() -> str | None:
202202
return _get_github_repository_from_env("GIT_URL")
203203
case _:
204204
return None
205-
206-
207-
def is_flaky_test_detection_enabled() -> bool:
208-
return utils.get_boolean_env("MERGIFY_TEST_FLAKY_DETECTION")

mergify_cli/ci/junit_processing/junit.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ async def junit_to_spans(
125125
if (provider := detector.get_ci_provider()) is not None:
126126
resource_attributes["cicd.provider.name"] = provider
127127

128-
if detector.is_flaky_test_detection_enabled():
129-
resource_attributes["mergify.test.flaky_detection_enabled"] = True
130-
131128
resource = resources.Resource.create(resource_attributes)
132129

133130
traceparent = os.environ.get("MERGIFY_TRACEPARENT")

mergify_cli/tests/ci/test_detector.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -163,28 +163,3 @@ def test_get_github_pull_request_number_unsupported_ci(
163163

164164
result = detector.get_github_pull_request_number()
165165
assert result is None
166-
167-
168-
@pytest.mark.parametrize(
169-
("env_value", "expected"),
170-
[
171-
("true", True),
172-
("1", True),
173-
("yes", True),
174-
("", False),
175-
("false", False),
176-
],
177-
)
178-
def test_is_flaky_test_detection_enabled(
179-
monkeypatch: pytest.MonkeyPatch,
180-
*,
181-
env_value: str,
182-
expected: bool,
183-
) -> None:
184-
if env_value:
185-
monkeypatch.setenv("MERGIFY_TEST_FLAKY_DETECTION", env_value)
186-
else:
187-
monkeypatch.delenv("MERGIFY_TEST_FLAKY_DETECTION", raising=False)
188-
189-
result = detector.is_flaky_test_detection_enabled()
190-
assert result == expected

mergify_cli/tests/ci/test_junit.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ async def test_parse(
4848
monkeypatch: pytest.MonkeyPatch,
4949
) -> None:
5050
monkeypatch.setenv("_MERGIFY_TEST_JOB_NAME", "foobar")
51-
monkeypatch.setenv("MERGIFY_TEST_FLAKY_DETECTION", "1")
5251
filename = pathlib.Path(__file__).parent / "junit_example.xml"
5352
run_id = (32312).to_bytes(8, "big").hex()
5453
spans = await junit.junit_to_spans(
@@ -79,7 +78,6 @@ async def test_parse(
7978
"telemetry.sdk.name": "opentelemetry",
8079
"telemetry.sdk.version": anys.ANY_STR,
8180
"mergify.test.job.name": "foobar",
82-
"mergify.test.flaky_detection_enabled": True,
8381
}
8482
assert dictified_spans == [
8583
{
@@ -555,6 +553,3 @@ async def test_traceparent_injection(
555553
assert spans[0].parent.span_id == 0x7A085853722DC6D2
556554
for span in spans:
557555
assert span.context.trace_id == 0x80E1AFED08E019FC1110464CFA66635C
558-
559-
# Flaky test detection is disabled by default.
560-
assert "mergify.test.flaky_detection_enabled" not in span.resource.attributes

0 commit comments

Comments
 (0)