Skip to content

move informing to junit property#31052

Draft
sosiouxme wants to merge 1 commit intoopenshift:mainfrom
sosiouxme:20260421-TRT-2622-informing-junits
Draft

move informing to junit property#31052
sosiouxme wants to merge 1 commit intoopenshift:mainfrom
sosiouxme:20260421-TRT-2622-informing-junits

Conversation

@sosiouxme
Copy link
Copy Markdown
Member

@sosiouxme sosiouxme commented Apr 22, 2026

Summary by CodeRabbit

  • Improvements
    • JUnit test reports now include lifecycle information as structured test case properties for enhanced visibility into test lifecycle states.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Walkthrough

These changes add support for test-case-level properties in JUnit XML output. A new TestCaseProperty struct was introduced to the JUnit API types with XML marshalling support, and JUnitTestCase now includes a Properties field. The junit.go file was updated to conditionally append lifecycle metadata as a property when present.

Changes

Cohort / File(s) Summary
JUnit API Types
pkg/test/ginkgo/junitapi/types.go
Added TestCaseProperty struct with name and value XML attributes, and added Properties field to JUnitTestCase for serializing test-case-level properties as properties>property XML elements.
JUnit Metadata Population
pkg/test/ginkgo/junit.go
Updated populateOTEMetadata to conditionally append a lifecycle TestCaseProperty to testCase.Properties when extensionResult.Lifecycle is not empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'move informing to junit property' clearly describes the main change: adding lifecycle metadata as a JUnit test case property.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies JUnit XML serialization infrastructure (junit.go and junitapi/types.go) to add lifecycle metadata properties, not test name definitions or dynamic naming logic.
Test Structure And Quality ✅ Passed The custom check reviews Ginkgo test code quality, but this PR modifies only infrastructure and utility code (report generation and XML data structures), not actual test files.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes are limited to test infrastructure modifications in junit.go and types.go for JUnit XML report generation.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. The changes are exclusively infrastructure-level modifications to the JUnit test result reporting system.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only test infrastructure code in pkg/test/ginkgo/ for JUnit reporting enhancements. The custom check applies only when deployment manifests, operator code, or controllers are added or modified. Since this PR contains none of these, the check is not applicable and passes by default.
Ote Binary Stdout Contract ✅ Passed PR changes are limited to adding XML marshalling types and modifying metadata population logic without introducing any stdout writes at process level.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies only JUnit XML serialization infrastructure without adding any new Ginkgo e2e tests, making the check not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@sosiouxme
Copy link
Copy Markdown
Member Author

/test e2e-aws-csi

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/test/ginkgo/junit.go (1)

37-42: Please add a focused regression test for lifecycle property serialization.

This changes JUnit output shape; add coverage for both cases: lifecycle set (property emitted) and lifecycle empty (property omitted).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/ginkgo/junit.go` around lines 37 - 42, Add a focused regression test
that verifies lifecycle property serialization: create two tests that exercise
the code path which builds junit test cases (using the same construction as the
code around extensionResult.Lifecycle and testCase.Properties); one test sets
extensionResult.Lifecycle to a non-empty value and asserts that a
junitapi.TestCaseProperty with Name "lifecycle" and Value equal to the lifecycle
string is present in testCase.Properties, and the other leaves
extensionResult.Lifecycle empty and asserts that no "lifecycle" property exists;
use the same types/variables referenced in the diff (extensionResult.Lifecycle,
testCase.Properties, junitapi.TestCaseProperty) and add these tests alongside
the existing ginkgo junit tests.
pkg/test/ginkgo/junitapi/types.go (1)

56-62: Consider a shared property type to reduce duplication.

TestSuiteProperty and TestCaseProperty currently have identical structure and tags. A shared Property type would keep this DRY and simplify future changes.

Also applies to: 86-88

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/ginkgo/junitapi/types.go` around lines 56 - 62, TestCaseProperty and
TestSuiteProperty share identical fields/tags; replace both with a single shared
struct (e.g., Property) that has XMLName xml.Name `xml:"property"`, Name string
`xml:"name,attr"`, and Value string `xml:"value,attr"`, then update usages:
rename TestCaseProperty and TestSuiteProperty types to Property (or alias them)
and update any code referencing TestCaseProperty or TestSuiteProperty to use
Property so future changes are centralized.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/test/ginkgo/junit.go`:
- Around line 37-42: Add a focused regression test that verifies lifecycle
property serialization: create two tests that exercise the code path which
builds junit test cases (using the same construction as the code around
extensionResult.Lifecycle and testCase.Properties); one test sets
extensionResult.Lifecycle to a non-empty value and asserts that a
junitapi.TestCaseProperty with Name "lifecycle" and Value equal to the lifecycle
string is present in testCase.Properties, and the other leaves
extensionResult.Lifecycle empty and asserts that no "lifecycle" property exists;
use the same types/variables referenced in the diff (extensionResult.Lifecycle,
testCase.Properties, junitapi.TestCaseProperty) and add these tests alongside
the existing ginkgo junit tests.

In `@pkg/test/ginkgo/junitapi/types.go`:
- Around line 56-62: TestCaseProperty and TestSuiteProperty share identical
fields/tags; replace both with a single shared struct (e.g., Property) that has
XMLName xml.Name `xml:"property"`, Name string `xml:"name,attr"`, and Value
string `xml:"value,attr"`, then update usages: rename TestCaseProperty and
TestSuiteProperty types to Property (or alias them) and update any code
referencing TestCaseProperty or TestSuiteProperty to use Property so future
changes are centralized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ee219c03-5a16-4bc8-a786-2782f96d3306

📥 Commits

Reviewing files that changed from the base of the PR and between 90131c2 and 69cad27.

📒 Files selected for processing (2)
  • pkg/test/ginkgo/junit.go
  • pkg/test/ginkgo/junitapi/types.go

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: coderabbitai[bot], sosiouxme

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sosiouxme
Copy link
Copy Markdown
Member Author

/test e2e-aws-ovn-fips
/test e2e-gcp-ovn

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

@sosiouxme: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant