Skip to content

Expose Cognitive Complexity metrics in GitLab-visible JUnit XML fields#86

Merged
fabian-barney merged 2 commits into
mainfrom
codex/85-gitlab-junit-metrics
Jun 1, 2026
Merged

Expose Cognitive Complexity metrics in GitLab-visible JUnit XML fields#86
fabian-barney merged 2 commits into
mainfrom
codex/85-gitlab-junit-metrics

Conversation

@fabian-barney

Copy link
Copy Markdown
Owner

Summary

  • add GitLab-visible cognitive complexity details to JUnit testcase names
  • add testcase-level system-out diagnostics while preserving existing JUnit properties and failure body text
  • update formatter tests, CLI report assertions, and README documentation

Validation

  • mvn -B -ntp -P!quality-gates-all -pl core '-Dtest=CliApplicationTest,ReportFormatterTest' test
  • mvn -B -ntp -P!quality-gates-all verify

Closes #85

Copilot AI review requested due to automatic review settings June 1, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the JUnit XML formatter so GitLab’s Tests UI can display Cognitive Complexity details by moving key metric data into GitLab-parsed fields (testcase@name and testcase-level system-out) while preserving existing JUnit properties and failure body diagnostics.

Changes:

  • Embed cognitive complexity in JUnit testcase name as method:lineStart [CC=complexity].
  • Add testcase-level system-out containing the full diagnostic text (complexity, threshold, source range, method).
  • Update formatter/CLI tests and README to match the new JUnit XML shape.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
README.md Documents the new GitLab-visible JUnit testcase name and testcase-level system-out behavior.
core/src/test/java/media/barney/cognitive/core/ReportFormatterTest.java Updates JUnit formatting assertions for the new testcase naming and system-out diagnostics.
core/src/test/java/media/barney/cognitive/core/CliApplicationTest.java Updates CLI JUnit-sidecar assertions to expect CC in testcase names.
core/src/main/java/media/barney/cognitive/core/ReportFormatter.java Implements updated JUnit testcase naming, adds testcase-level system-out, and reuses diagnostic text for failure bodies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/java/media/barney/cognitive/core/ReportFormatter.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@fabian-barney fabian-barney merged commit 2d53c59 into main Jun 1, 2026
21 checks passed
@fabian-barney fabian-barney deleted the codex/85-gitlab-junit-metrics branch June 1, 2026 15:00
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.

Expose Cognitive Complexity metrics in GitLab-visible JUnit XML fields

2 participants