Skip to content

Conversation

torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented Sep 13, 2025

CBG-4852 replace go2xunit with gotestsum

This should prevent the errors we see where go2xunit crashes:

/home/ec2-user/go/bin/go2xunit -input verbose_int.out -output verbose_int.xml
error: 724791: name mismatch (try disabling parallel mode)
  • use gotestsum to produce junit output, which is natively parsed by jenkins
  • use xmlstarlet to add prefix like go2xunit for --suite-name-prefix
  • use --junitfile-project-name to force jenkins to not collapse matching test results together. This isn't visible externally but just used jenkins junit plugin
  • remove .raw files, since the whole reason to strip non printable characters is so that go2xunit can parse them
  • add script block to Jenkinsfile to allow capturing error codes from sh command as a groovy variable instead of relying on parsing an output file

Normal Jenkins integration test output (stays the same):

https://jenkins.sgwdev.com/job/SyncGatewayIntegration/91/

Example of pipeline failures (with CE/EE, like main):

https://jenkins.sgwdev.com/job/Pipeline/view/change-requests/job/PR-7766/3/

Example of integration test failure:

https://jenkins.sgwdev.com/job/gotestsum-expr/18/

@Copilot Copilot AI review requested due to automatic review settings September 13, 2025 14:23
Copy link
Contributor

@Copilot Copilot AI left a comment

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 replaces the go2xunit tool with gotestsum for test execution and JUnit XML report generation in both the main Jenkins pipeline and integration build scripts. The change aims to modernize the testing infrastructure and improve test reporting capabilities.

Key changes:

  • Replace go2xunit with gotestsum for JUnit XML generation
  • Simplify test execution by integrating XML output directly into test commands
  • Remove manual post-processing steps for cleaning test output

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
jenkins-integration-build.sh Replaces go2xunit installation and usage with gotestsum, removes manual XML generation steps
Jenkinsfile Updates main pipeline to use gotestsum for both CE and EE unit tests, simplifies test execution logic
.editorconfig Adds shell script formatting configuration (unrelated to main changes)

@torcolvin torcolvin changed the title test gotestsum with main pipeline WIP/CI test: test gotestsum with main pipeline Sep 15, 2025
@torcolvin torcolvin force-pushed the CBG-4852 branch 5 times, most recently from 9a32b17 to d9e0a27 Compare September 17, 2025 16:18
@torcolvin torcolvin changed the title WIP/CI test: test gotestsum with main pipeline CBG-4852 replace go2xunit with gotestsum Sep 18, 2025
@torcolvin torcolvin requested a review from Copilot September 18, 2025 16:41
Copy link
Contributor

@Copilot Copilot AI left a comment

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 2 out of 2 changed files in this pull request and generated 2 comments.

@torcolvin torcolvin force-pushed the CBG-4852 branch 2 times, most recently from 26222ed to 0a23407 Compare September 18, 2025 16:59
Copy link
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

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

LGTM 👍 great QoL change with the fixed "failed log output" as well

@bbrks bbrks merged commit 3f51136 into main Sep 19, 2025
42 checks passed
@bbrks bbrks deleted the CBG-4852 branch September 19, 2025 12:58
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