Skip to content

Conversation

@AndrianBdn
Copy link
Contributor

Summary

  • Centralize all marker detection/extraction/matching into a new MarkerParser class, replacing scattered regex logic across misc.ts, ResultUploadCommandHandler, and ResultUploader
  • Add CamelCase hyphenless marker support for Go/Java-style test names (e.g., TestPrj002CartItems, TestCartItemsPrj002)
  • Enforce hyphenless matching (underscore-separated + CamelCase) as JUnit-only — Playwright JSON continues to support only hyphenated markers and annotations
  • ResultUploader now receives MarkerParser from ResultUploadCommandHandler (shared instance)
  • Bump version to 0.4.6

Test plan

  • All 119 existing + new tests pass (npm test)
  • Typecheck + lint + format clean (npm run check)
  • Verify CamelCase matching with real Go/Java JUnit XML reports
  • Verify Playwright JSON upload still works with hyphenated markers only (no false hyphenless matches)

Centralize marker detection/extraction/matching into a new MarkerParser
class, replacing scattered regex logic in misc.ts, ResultUploadCommandHandler,
and ResultUploader. Add camelCase marker support (Go/Java-style test names
like TestPrj002Foo) alongside existing hyphenated and underscore-separated
formats. Hyphenless matching is enforced as JUnit-only.
@gemini-code-assist
Copy link

Summary of Changes

Hello @AndrianBdn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors how test case markers are handled by introducing a dedicated MarkerParser class. This change centralizes marker logic, making it more robust and extensible. It also expands the CLI's capabilities by adding support for new hyphenless marker formats, such as CamelCase and underscore-separated, specifically for JUnit XML reports, which improves compatibility with various testing frameworks like Go, Java, and pytest. The update ensures that Playwright JSON reports maintain their existing hyphenated marker behavior, preventing unintended matching.

Highlights

  • Centralized Marker Parsing: All test case marker detection, extraction, and matching logic has been centralized into a new MarkerParser class, replacing scattered regex implementations across misc.ts, ResultUploadCommandHandler, and ResultUploader.
  • New Marker Formats for JUnit: Added support for CamelCase hyphenless markers (e.g., TestPrj002CartItems) and underscore-separated hyphenless markers (e.g., test_prj002_foo) specifically for JUnit XML reports, catering to Go/Java and pytest-style test names.
  • Playwright JSON Marker Consistency: Hyphenless matching (underscore-separated and CamelCase) is now exclusively enforced for JUnit-only uploads. Playwright JSON uploads continue to support only hyphenated markers and annotations, preventing false matches.
  • Dependency Injection for MarkerParser: ResultUploader now receives a shared instance of MarkerParser from ResultUploadCommandHandler, promoting better code organization and reusability.
  • Version Bump: The project version has been updated to 0.4.6.
Changelog
  • CLAUDE.md
    • Updated documentation to reflect the introduction and role of the new MarkerParser class within the core upload pipeline.
    • Expanded the description of marker formats supported by MarkerParser, including hyphenated, underscore-separated, and CamelCase hyphenless markers.
    • Added a note about the formatMarker() function being exported for use by parsers.
  • README.md
    • Updated JUnit XML section to detail the newly supported marker formats: Hyphenated, Underscore-Separated Hyphenless, and CamelCase Hyphenless.
    • Provided examples for each new marker format, including pytest, Go, and Java styles.
    • Clarified that hyphenless matching is only available for junit-upload and not for playwright-json-upload.
    • Updated Playwright JSON section to explicitly state that hyphenless markers are not supported.
  • package-lock.json
    • Updated the package version to 0.4.6.
  • package.json
    • Updated the package version to 0.4.6.
  • src/tests/fixtures/junit-xml/camelcase-matching-tcases.xml
    • Added a new JUnit XML fixture file to test CamelCase marker matching scenarios.
  • src/tests/fixtures/junit-xml/hyphenless-matching-tcases.xml
    • Added a new JUnit XML fixture file to test underscore-separated hyphenless marker matching scenarios.
  • src/tests/marker-parser.spec.ts
    • Added a new unit test file for the MarkerParser class.
    • Implemented comprehensive tests for formatMarker, detectProjectCode, extractSeq, and nameMatchesTCase methods.
    • Verified correct behavior across hyphenated, underscore-separated hyphenless, and CamelCase marker formats for both JUnit and Playwright contexts.
  • src/tests/result-upload.spec.ts
    • Extended integration tests to include new test suites for hyphenless and CamelCase test case markers.
    • Verified that hyphenless and CamelCase markers in JUnit XML are correctly mapped to run test cases when uploading with --run-url, auto-detected project code, and explicit --project-code.
  • src/utils/misc.ts
    • Removed the getTCaseMarker utility function, as its functionality has been migrated to the new MarkerParser class.
  • src/utils/result-upload/MarkerParser.ts
    • Introduced a new MarkerParser class to centralize all test case marker detection, extraction, and matching logic.
    • Implemented formatMarker, detectProjectCode, extractSeq, and nameMatchesTCase methods to handle various marker formats (hyphenated, underscore-separated, CamelCase).
    • Added logic to differentiate marker parsing behavior based on UploadCommandType (JUnit vs. Playwright).
  • src/utils/result-upload/ResultUploadCommandHandler.ts
    • Imported and instantiated the new MarkerParser class.
    • Refactored detectProjectCodeFromTCaseNames, getTCaseIds, and createNewTCases to utilize the MarkerParser for marker detection and formatting.
    • Removed the internal execRegexWithPriority method, delegating regex execution to MarkerParser.
    • Modified uploadResults to pass the MarkerParser instance to ResultUploader.
  • src/utils/result-upload/ResultUploader.ts
    • Imported the MarkerParser type.
    • Modified the constructor to accept a MarkerParser instance.
    • Updated mapResultsToTestCases to use markerParser.nameMatchesTCase for matching test results to test cases.
  • src/utils/result-upload/playwrightJsonParser.ts
    • Imported the formatMarker function from MarkerParser.
    • Updated getTCaseMarkerFromAnnotations to use the new formatMarker function.
Activity
  • All 119 existing and new tests have passed (npm test).
  • Typechecking, linting, and formatting checks are clean (npm run check).
  • Manual verification is pending for CamelCase matching with real Go/Java JUnit XML reports.
  • Manual verification is pending for Playwright JSON upload to ensure it still works correctly with only hyphenated markers and no false hyphenless matches.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a MarkerParser class to centralize test marker parsing logic and adds support for CamelCase markers, which is a great improvement for maintainability and functionality. The refactoring is well-executed across the affected files. However, I've identified a critical issue where the new hyphenless marker parsing logic doesn't support alphanumeric project codes, which is a regression from the existing hyphenated marker support. I've also found a couple of inconsistencies regarding case-sensitive matching for hyphenated markers. Please see my detailed comments for suggestions on how to address these issues.

@AndrianBdn AndrianBdn changed the title Add MarkerParser class with camelCase support Add MarkerParser class with snake_case and camelCase support Feb 10, 2026
@AndrianBdn AndrianBdn requested a review from satvik007 February 10, 2026 11:00
Copy link
Collaborator

@satvik007 satvik007 left a comment

Choose a reason for hiding this comment

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

Thanks @AndrianBdn

Copy link
Collaborator

Choose a reason for hiding this comment

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

These test cases are not very useful. Atleast we should be checking if the length is correct.
This was not introduced here, so should do it in a separate PR for all existing tests.

@satvik007 satvik007 merged commit b47aa71 into main Feb 10, 2026
3 checks passed
@satvik007 satvik007 deleted the feature/marker-parser-camelcase branch February 10, 2026 13:57
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