Skip to content

fix(build): update surefire report processing to handle time format#2962

Merged
liferoad merged 6 commits intoGoogleCloudPlatform:mainfrom
liferoad:improve-sed
Nov 5, 2025
Merged

fix(build): update surefire report processing to handle time format#2962
liferoad merged 6 commits intoGoogleCloudPlatform:mainfrom
liferoad:improve-sed

Conversation

@liferoad
Copy link
Contributor

@liferoad liferoad commented Nov 4, 2025

  • disable cache when using cloud build
  • sed changes:
    Before sed:
<testsuite>
  <testcase name="test1" time="1,147.352"/>
  <testcase name="test2" time="1,234,567.890"/>
  <testcase name="test3" time="123.456"/>
  <testcase name="test4" time="1,234"/>
  <testcase name="test5" time="1,234,567"/>
  <testcase name="test6" time="0.123"/>
</testsuite>

After sed:

<testsuite>
  <testcase name="test1" time="1147.352"/>
  <testcase name="test2" time="1234567.890"/>
  <testcase name="test3" time="123.456"/>
  <testcase name="test4" time="1234"/>
  <testcase name="test5" time="1234567"/>
  <testcase name="test6" time="0.123"/>
</testsuite>

TODO:

  • remove the version pins for jsonschema
  • explore using cache with the template name as the part of URLs

…nd skip on errors

Modify sed command to properly handle time format in test reports and add skipSurefireReport configuration to prevent build failures when encountering parsing issues
@gemini-code-assist
Copy link

Summary of Changes

Hello @liferoad, 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 addresses an issue in the build process related to Surefire report parsing. It modifies the pom.xml to enhance the handling of time formats in test reports by removing commas that could cause parsing errors. Additionally, it introduces a safeguard to prevent build failures if report parsing issues persist, ensuring a more resilient build pipeline.

Highlights

  • Surefire Report Time Format Fix: The sed command used to preprocess Surefire XML reports has been updated to correctly handle time formats that include commas. The previous command only replaced the first comma, while the new one iteratively removes all commas within the time attribute value, ensuring proper numeric parsing.
  • Build Robustness: A new configuration has been added to the maven-surefire-report-plugin to skip report generation if parsing issues are encountered. This prevents the build from failing due to malformed Surefire reports, improving overall build stability.
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.

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.31%. Comparing base (be5e9dc) to head (bf558c6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2962      +/-   ##
============================================
- Coverage     50.31%   50.31%   -0.01%     
+ Complexity     4998     4995       -3     
============================================
  Files           966      966              
  Lines         59134    59131       -3     
  Branches       6440     6440              
============================================
- Hits          29756    29753       -3     
+ Misses        27274    27272       -2     
- Partials       2104     2106       +2     
Components Coverage Δ
spanner-templates 70.46% <ø> (-0.02%) ⬇️
spanner-import-export 69.06% <ø> (-0.04%) ⬇️
spanner-live-forward-migration 79.69% <ø> (ø)
spanner-live-reverse-replication 77.06% <ø> (ø)
spanner-bulk-migration 88.33% <ø> (ø)
Files with missing lines Coverage Δ
...loud/teleport/plugin/maven/TemplatesStageMojo.java 8.26% <ø> (+0.04%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jrmccluskey
jrmccluskey previously approved these changes Nov 4, 2025
@jrmccluskey
Copy link
Contributor

Re-running the integration test workflow before merging, this PR is a release blocker though

@liferoad
Copy link
Contributor Author

liferoad commented Nov 5, 2025

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 914.844 s <<< FAILURE! - in com.google.cloud.teleport.templates.python.PubSubToBigQueryYamlIT

https://console.cloud.google.com/dataflow/jobs/us-west2/2025-11-04_12_34_30-9026170459237494653?project=cloud-teleport-testing

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/jsonschema_specifications/schemas/draft201909/vocabularies/format

@pull-request-size pull-request-size bot added size/M and removed size/XS labels Nov 5, 2025
@liferoad
Copy link
Contributor Author

liferoad commented Nov 5, 2025

https://pantheon.corp.google.com/cloud-build/builds;region=global/63da88fc-9b25-4d90-8399-3a5cedcc9676;step=0?e=13802955&mods=dm_deploy_from_gcs&project=cloud-teleport-testing seems fine now without using cache.

docker run -it --entrypoint=sh gcr.io/cloud-teleport-testing/yaml-template:2025-11-05-18-25-33_IT
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
# python
Python 3.11.14 (main, Oct  9 2025, 22:39:56) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jsonschema

@liferoad liferoad merged commit b2fbe03 into GoogleCloudPlatform:main Nov 5, 2025
77 of 84 checks passed
aasthabharill pushed a commit that referenced this pull request Dec 10, 2025
…2962)

* fix(build): update surefire report processing to handle time format and skip on errors

Modify sed command to properly handle time format in test reports and add skipSurefireReport configuration to prevent build failures when encountering parsing issues

* check import jsonschema

* use python

* use python3

* disable cache

* fixed the dockerfile
MnkyGns pushed a commit to MnkyGns/DataflowTemplates that referenced this pull request Feb 12, 2026
…oogleCloudPlatform#2962)

* fix(build): update surefire report processing to handle time format and skip on errors

Modify sed command to properly handle time format in test reports and add skipSurefireReport configuration to prevent build failures when encountering parsing issues

* check import jsonschema

* use python

* use python3

* disable cache

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants