Skip to content

Implement attempt to fix v3 and v4 and bump capability version #8824

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

Merged
merged 3 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ public Map<TestSetting, Map<String, Collection<TestFQN>>> getTestManagementTests
new TestManagementDto(
tracerEnvironment.getRepositoryUrl(),
tracerEnvironment.getCommitMessage(),
tracerEnvironment.getConfigurations().getTestBundle())));
tracerEnvironment.getConfigurations().getTestBundle(),
tracerEnvironment.getSha())));
String json = testManagementRequestAdapter.toJson(request);
RequestBody requestBody = RequestBody.create(JSON, json);
TestManagementTestsDto testManagementTestsDto =
Expand Down Expand Up @@ -542,11 +543,14 @@ private static final class TestManagementDto {
private final String commitMessage;

private final String module;
private final String sha;

private TestManagementDto(String repositoryUrl, String commitMessage, String module) {
private TestManagementDto(
String repositoryUrl, String commitMessage, String module, String sha) {
this.repositoryUrl = repositoryUrl;
this.commitMessage = commitMessage;
this.module = module;
this.sha = sha;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ public void onTestFinish(

if (testExecutionHistory.hasFailedAllRetries()) {
test.setTag(Tags.TEST_HAS_FAILED_ALL_RETRIES, true);
} else if (testExecutionHistory.hasSucceededAllRetries()
&& testModule.isAttemptToFix(thisTest)) {
test.setTag(Tags.TEST_TEST_MANAGEMENT_ATTEMPT_TO_FIX_PASSED, true);
}

if (testExecutionHistory.wasLastExecution() && testModule.isAttemptToFix(thisTest)) {
test.setTag(
Tags.TEST_TEST_MANAGEMENT_ATTEMPT_TO_FIX_PASSED,
testExecutionHistory.hasSucceededAllRetries());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"id" : "${uid}",
"attributes": {
"repository_url" : "${tracerEnvironment.repositoryUrl}",
"commit_message" : "${tracerEnvironment.commitMessage}"
"commit_message" : "${tracerEnvironment.commitMessage}",
"sha" : "${tracerEnvironment.sha}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import datadog.trace.api.civisibility.config.TestFQN
import spock.lang.Specification

abstract class CiVisibilitySmokeTest extends Specification {
static final List<String> SMOKE_IGNORED_TAGS = ["content.meta.['_dd.integration']"]

protected verifyEventsAndCoverages(String projectName, String toolchain, String toolchainVersion, List<Map<String, Object>> events, List<Map<String, Object>> coverages) {
def additionalReplacements = ["content.meta.['test.toolchain']": "$toolchain:$toolchainVersion"]

if (System.getenv().get("GENERATE_TEST_FIXTURES") != null) {
def baseTemplatesPath = CiVisibilitySmokeTest.classLoader.getResource(projectName).toURI().schemeSpecificPart.replace('build/resources/test', 'src/test/resources')
CiVisibilityTestUtils.generateTemplates(baseTemplatesPath, events, coverages, additionalReplacements)
CiVisibilityTestUtils.generateTemplates(baseTemplatesPath, events, coverages, additionalReplacements, SMOKE_IGNORED_TAGS)
} else {
CiVisibilityTestUtils.assertData(projectName, events, coverages, additionalReplacements,["content.meta.['_dd.integration']"])
CiVisibilityTestUtils.assertData(projectName, events, coverages, additionalReplacements, SMOKE_IGNORED_TAGS)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedMUnit",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.traits" : "{\"category\":[\"myTag\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedMUnit",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.traits" : "{\"category\":[\"myTag\"]}",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedMUnit",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.traits" : "{\"category\":[\"myTag\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.traits" : "{\"category\":[\"foo\"]}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
"test.source.method" : "test failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedSpock",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
"test.source.method" : "test failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedSpock",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
"test.source.method" : "test failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailedSpock",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "[org/example/test_failed] test failed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "[org/example/test_failed] test failed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@
"test.retry_reason" : "attempt_to_fix",
"test.status" : "fail",
"test.suite" : "[org/example/test_failed] test failed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"test.source.file" : "dummy_source_path",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_test_disabled" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.type" : "test",
"test_session.name" : "session-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
"test.source.method" : "test_failed()V",
"test.status" : "fail",
"test.suite" : "org.example.TestFailed",
"test.test_management.attempt_to_fix_passed" : "false",
"test.test_management.is_attempt_to_fix" : "true",
"test.test_management.is_quarantined" : "true",
"test.type" : "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_7},
Expand Down Expand Up @@ -305,7 +305,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_8},
Expand Down Expand Up @@ -369,7 +369,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_9},
Expand Down Expand Up @@ -433,7 +433,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_10},
Expand Down Expand Up @@ -497,7 +497,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_11},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_6},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_7},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"_dd.library_capabilities.fail_fast_test_order" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_7},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"_dd.library_capabilities.fail_fast_test_order" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_7},
Expand Down Expand Up @@ -301,7 +301,7 @@
"_dd.library_capabilities.fail_fast_test_order" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_8},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_6},
Expand Down Expand Up @@ -249,7 +249,7 @@
"_dd.library_capabilities.early_flake_detection" : "1",
"_dd.library_capabilities.impacted_tests" : "1",
"_dd.library_capabilities.test_impact_analysis" : "1",
"_dd.library_capabilities.test_management.attempt_to_fix" : "2",
"_dd.library_capabilities.test_management.attempt_to_fix" : "4",
"_dd.library_capabilities.test_management.disable" : "1",
"_dd.library_capabilities.test_management.quarantine" : "1",
"_dd.p.tid" : ${content_meta__dd_p_tid_7},
Expand Down
Loading
Loading