Skip to content

Fix reportNameSuffix in XML testcase classname - #3379

Merged
olamy merged 1 commit into
apache:masterfrom
goutamadwant:fix-surefire-3210-report-name-suffix
Jun 27, 2026
Merged

olamy merged 1 commit into
apache:masterfrom
goutamadwant:fix-surefire-3210-report-name-suffix

Conversation

@goutamadwant

Copy link
Copy Markdown
Contributor

Fixes #3210

Summary

This preserves reportNameSuffix on the XML <testcase classname="..."> attribute when Surefire falls back from a missing qualified source name to the report source text.

The XML reporter already applies the suffix when a qualified source name is available. The missing case was the fallback path, where sourceText was returned without applying the configured suffix.

Changes

  • apply reportNameSuffix consistently through WrappedReportEntry#getSourceQualifiedName
  • add focused unit coverage for the fallback path
  • add an integration test fixture that verifies the generated XML report contains the suffix in both the test suite name and testcase classname

Verification

  • mvn -pl maven-surefire-common -Dtest=WrappedReportEntryTest,StatelessXmlReporterTest test
  • mvn -pl maven-surefire-common -DskipTests -Dinvoker.skip=true install
  • mvn -pl surefire-its -P run-its -Dit.test=Surefire3210ReportNameSuffixIT -Dits.forkCount=1 -Dinvoker.skip=true verify
  • mvn -pl surefire-its -am -DskipTests -Dinvoker.skip=true install
  • mvn clean install
  • mvn -Prun-its clean install
  • git diff --check

Checklist

  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.

@olamy olamy added the bug Something isn't working label Jun 27, 2026
@olamy olamy added this to the 3.6.0-M2 milestone Jun 27, 2026
@olamy
olamy merged commit c633042 into apache:master Jun 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing suffix in testcase classname XML report

2 participants