Skip to content
Draft
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
3 changes: 3 additions & 0 deletions pkg/apis/junit/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ type TestCase struct {
// Duration is the time taken in seconds to run the test
Duration float64 `xml:"time,attr"`

// Lifecycle is the lifecycle of this test case
Lifecycle string `xml:"lifecycle,attr"`

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

Expand Down
37 changes: 37 additions & 0 deletions pkg/dataloader/prowloader/extract_test_cases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,43 @@ func TestExtractTestCases(t *testing.T) {
},
},
},
{
name: "passing test with lifecycle",
suite: &junit.TestSuite{
Name: "openshift-tests",
TestCases: []*junit.TestCase{
{Name: "test-a", Duration: 1.5, Lifecycle: "informing"},
},
},
expected: map[testCaseKey]*types.TestCaseEntry{
{SuiteName: "openshift-tests", TestName: "test-a"}: {
TestName: "test-a",
SuiteName: "openshift-tests",
Status: int(sippyprocessingv1.TestStatusSuccess),
Duration: 1.5,
Lifecycle: "informing",
},
},
},
{
name: "failing test with output and lifecycle",
suite: &junit.TestSuite{
Name: "openshift-tests",
TestCases: []*junit.TestCase{
{Name: "test-a", Duration: 2.0, FailureOutput: &junit.FailureOutput{Output: failMsg}, Lifecycle: "blocking"},
},
},
expected: map[testCaseKey]*types.TestCaseEntry{
{SuiteName: "openshift-tests", TestName: "test-a"}: {
TestName: "test-a",
SuiteName: "openshift-tests",
Status: int(sippyprocessingv1.TestStatusFailure),
Duration: 2.0,
Output: &failMsg,
Lifecycle: "blocking",
},
},
},
}

for _, tt := range tests {
Expand Down
1 change: 1 addition & 0 deletions pkg/dataloader/prowloader/prow.go
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,7 @@ func extractTestCases(suite *junit.TestSuite, testCases map[testCaseKey]*types.T
Status: int(status),
Duration: tc.Duration,
Output: output,
Lifecycle: tc.Lifecycle,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Propagate Lifecycle into the returned test rows.

extractTestCases now stores the value in TestCaseEntry, but prowJobRunTestsFromGCS builds prowJobRunTestRow values without assigning Lifecycle at Lines 1676-1686. The metadata is therefore dropped before this loader returns its results; extend the row contract and copy the field there as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/dataloader/prowloader/prow.go` at line 1720, Update prowJobRunTestRow
construction in prowJobRunTestsFromGCS to include the Lifecycle value from each
TestCaseEntry, and extend the row contract or struct as needed so the metadata
is preserved in the loader results.

}
} else if (existing.Status == int(sippyprocessingv1.TestStatusFailure) && status == sippyprocessingv1.TestStatusSuccess) ||
(existing.Status == int(sippyprocessingv1.TestStatusSuccess) && status == sippyprocessingv1.TestStatusFailure) {
Expand Down
1 change: 1 addition & 0 deletions pkg/dataloader/prowloader/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ type TestCaseEntry struct {
Status int
Duration float64
Output *string
Lifecycle string
}