8000 junit: support ReportEntry by pohly · Pull Request #1682 · onsi/ginkgo · GitHub
[go: up one dir, main page]

Skip to content

junit: support ReportEntry - #1682

Merged
onsi merged 1 commit into
onsi:masterfrom
pohly:junit-report-entries
Sep 12, 2026
Merged

onsi merged 1 commit into
onsi:masterfrom
pohly:junit-report-entries

Conversation

@pohly
@pohly pohly commented Sep 9, 2026
Copy link
Copy Markdown
Contributor

Some JUnit tools support a "properties" element at the "testcase" level. This can be used to stored the ReportEntries attached to a spec. The string representation was chosen because the JUnit format seems to imply that this meant to be human-readable.

8000 Comment thread reporters/junit_report.go Outdated
for _, entry := range spec.ReportEntries {
properties.Properties = append(properties.Properties, JUnitProperty{
Name: entry.Name,
Value: entry.StringRepresentation(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's one potential issue: this will prefer the colored string if available, which is less suitable here than plain string. Is this worth addressing? Would imply changing StringRepresentation.

Or use a JSON dump as string after all?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

My instinct is to go with the JSON dump as the string as that enables structured objects to flow into the reports more naturally and it would align with what the Ginkgo JSON report does. If you want a non-colored string though then I'dd add a new entry.NoColorStringRepresentation()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, let's go with JSON then. I need to check how to get to that, though - if I remember correctly, it needs a new method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yep that's right. it mirrors ReportEntryValue.MarshalJSON()

@onsi
onsi commented Sep 9, 2026
Copy link
Copy Markdown
Owner
8000

hey @pohly this LGTM - i replied to your comment. feel free to take it in whatever direction you'd like. just let me know when you're happy with it and i'll pull it in and cut a release.

Some JUnit tools support a "properties" element at the "testcase" level. This
can be used to stored the ReportEntries attached to a spec. The string
representation was chosen because the JUnit format seems to imply that this
meant to be human-readable.
@pohly
pohly force-pushed the junit-report-entries branch from 23fa08b to 3dad23b Compare September 10, 2026 14:08
@onsi
onsi merged commit 23db51a into onsi:master Sep 12, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0