Skip to content
Open
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
6 changes: 6 additions & 0 deletions pkg/jobrunaggregator/jobrunaggregatoranalyzer/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ func aggregateTestCase(testSuiteName string, combined *junit.TestCase, jobGCSBuc
}
}

// Store lifecycle from the test case - informing tests will be treated as always passing
// in the pass/fail calculation
if toAdd.Lifecycle != "" {
currDetails.Lifecycle = toAdd.Lifecycle
}

switch {
case toAdd.FailureOutput != nil:
humanURL := jobrunaggregatorapi.GetHumanURLForLocation(path.Join(jobGCSBucketRoot, toAddJobRunID), "test-platform-results")
Expand Down
5 changes: 5 additions & 0 deletions pkg/jobrunaggregator/jobrunaggregatoranalyzer/pass_fail.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ func (a *weeklyAverageFromTenDays) innerCheckPercentileDisruptionWithGrace(
}

func (a *weeklyAverageFromTenDays) CheckFailed(ctx context.Context, jobName string, suiteNames []string, testCaseDetails *jobrunaggregatorlib.TestCaseDetails) (testCaseStatus, string, error) {
// Informing tests do not impact aggregation, so treat them as always passing
if testCaseDetails.Lifecycle == "informing" {
reason := fmt.Sprintf("always passing %q: informing test does not impact aggregation\n", testCaseDetails.Name)
return testCasePassed, reason, nil
}
if reason := testShouldAlwaysPass(jobName, testCaseDetails.Name, testCaseDetails.TestSuiteName); len(reason) > 0 {
reason := fmt.Sprintf("always passing %q: %v\n", testCaseDetails.Name, reason)
return testCasePassed, reason, nil
Expand Down
3 changes: 3 additions & 0 deletions pkg/jobrunaggregator/jobrunaggregatorlib/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ type TestCaseDetails struct {
TestSuiteName string
// Summary is filled in during the pass/fail calculation
Summary string
// Lifecycle indicates whether the test is blocking or informing.
// Informing tests do not impact aggregation.
Lifecycle string

Passes []TestCasePass
Failures []TestCaseFailure
Expand Down
6 changes: 6 additions & 0 deletions pkg/junit/testdata/zz_fixture_TestCensorTestSuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Children:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow very nested XXXXXX
SkipMessage:
Message: skipped due to very nested XXXXXX
Expand All @@ -45,6 +46,7 @@ Children:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow also very nested XXXXXX
SkipMessage:
Message: also skipped due to very nested XXXXXX
Expand Down Expand Up @@ -84,6 +86,7 @@ Children:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow nested XXXXXX
SkipMessage:
Message: skipped due to nested XXXXXX
Expand All @@ -103,6 +106,7 @@ Children:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow also nested XXXXXX
SkipMessage:
Message: also skipped due to nested XXXXXX
Expand Down Expand Up @@ -142,6 +146,7 @@ TestCases:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow XXXXXX
SkipMessage:
Message: skipped due to XXXXXX
Expand All @@ -161,6 +166,7 @@ TestCases:
XMLName:
Local: ""
Space: ""
Lifecycle: ""
Name: somehow also XXXXXX
SkipMessage:
Message: also skipped due to XXXXXX
Expand Down
4 changes: 4 additions & 0 deletions pkg/junit/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ type TestCase struct {
// Duration is the time taken in seconds to run the test
Duration float64 `xml:"time,attr"`

// Lifecycle indicates whether the test is blocking or informing.
// Informing tests do not impact aggregation.
Lifecycle string `xml:"lifecycle,attr,omitempty"`

// SkipMessage holds the reason why the test was skipped
SkipMessage *SkipMessage `xml:"skipped"`

Expand Down