-
Notifications
You must be signed in to change notification settings - Fork 497
feat(civisibility): add test.final_status tag for adjusted test outcomes #4379
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-01-27 15:02:19 Comparing candidate commit e2addd8 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 157 metrics, 7 unstable metrics. |
e730220 to
de04d2d
Compare
This adds a new `test.final_status` tag that indicates the final adjusted status for a test after considering all executions (retries). The priority order is: - Quarantined/Disabled -> skip - Any pass in retries -> pass - Any fail (no pass) -> fail - Current is skip -> skip - Default -> fail Key changes: - Add TestFinalStatus constant and calculateFinalStatus() helper - Add isFinalExecution() to determine when to set the tag - Track anyExecutionPassed/anyExecutionFailed across retries - Propagate isEfdInParallel flag to subtests for parallel EFD (Option A) - Set test.final_status in instrumentCloseAndSkip/instrumentSkipNow for non-wrapper tests - ATF takes precedence over parallel EFD for final status computation - Preserve skip reason through skipReason field for wrapper tests - Add test assertions for final_status in testcontroller_test.go and subtestcontroller_test.go
de04d2d to
a3dfbb1
Compare
| return constants.TestStatusSkip | ||
| } | ||
| if anyPassed { | ||
| return constants.TestStatusPass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would not be right for the attempt to fix flow:
If the test is in attempt-to-fix flow, it should be reported to the test framework as failed if any of the retries failed - so flaky test that is still flaky in attempt-to-fix fails the build.
I was recently fixing this issue for the Ruby library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, great, changed in e2addd8
For Attempt-To-Fix (ATF) tests, the final_status should be 'fail' if any execution failed, even if some passed. This ensures flaky tests that are still flaky in ATF mode fail the build, correctly verifying that a fix actually resolves the flakiness. Updated calculateFinalStatus() priority order: 1. quarantined/disabled -> skip (unchanged) 2. ATF && anyFailed -> fail (NEW) 3. anyPassed -> pass 4. anyFailed -> fail 5. currentIsSkip -> skip 6. default -> fail
What does this PR do?
JIRA: SDTEST-2986
Adds a new
test.final_statustag to CI Visibility test spans that indicates the final adjusted status for a test after considering all executions (including retries). This helps distinguish between the raw test outcome and the final computed result.The priority order for determining final status is:
skip(management directives take precedence)pass(a single pass means the test ultimately passed)fail(all executions failed)skip(single-execution skip)failKey Changes
TestFinalStatus = "test.final_status"inconstants/test_tags.gofinal_status.gowith helper functions:calculateFinalStatus()- computes the final status based on execution outcomesisFinalExecution()- determines if current execution is the last one (no more retries)computeAdjustedRetryCount()- mirrors retry count logic for predictionwillRetryAfterExecution()- predicts if another retry will happenanyExecutionPassed,anyExecutionFailed,remainingRetries,isEfdInParallel, andskipReasonfields totestExecutionMetadataisEfdInParallelandhasAdditionalFeatureWrapperare propagated to subtestsinstrumentCloseAndSkipreturns early, use it in defer blocktest.final_statusfor parallel EFD (impossible to determine final execution)test.final_statuseven when parallel EFD is enabledtestcontroller_test.goandsubtestcontroller_test.goMotivation
The
test.final_statustag allows CI Visibility consumers to understand the ultimate outcome of a test after all retries and management directives have been applied. This is particularly useful for:Test Plan
testcontroller_test.go)subtestcontroller_test.go)test.final_statusassertions for:Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!