Skip to content

feat: integrate gotestsum and add test documentation - #59

Merged
usman-muzaffar555 merged 5 commits into
mainfrom
feat/PLAT-624/integrate-gotestsum-framework
Jun 2, 2026
Merged

feat: integrate gotestsum and add test documentation#59
usman-muzaffar555 merged 5 commits into
mainfrom
feat/PLAT-624/integrate-gotestsum-framework

Conversation

@usman-muzaffar555

Copy link
Copy Markdown
Member
  • Replace go test calls with gotestsum for better test output formatting
  • Add docs/running-tests.md with Mac and Linux prerequisites and all make targets

- Replace go test calls with gotestsum for better test output formatting
- Add docs/running-tests.md with Mac and Linux prerequisites and all make targets
@usman-muzaffar555
usman-muzaffar555 requested a review from mmols May 22, 2026 08:09
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edd82486-ae56-4970-8df3-7267cc40b2ba

📥 Commits

Reviewing files that changed from the base of the PR and between 89c0535 and 783d877.

📒 Files selected for processing (2)
  • .github/workflows/test.yaml
  • test/Makefile
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/test.yaml
  • test/Makefile

📝 Walkthrough

Walkthrough

Standardize integration tests on gotestsum with a computed GO_TIMEOUT, add make targets and a CI step to install gotestsum, extend kind readiness waits to 300s, remove legacy ct targets from the root Makefile, and add comprehensive test documentation in test/README.md.

Changes

Test Runner Migration and Documentation

Layer / File(s) Summary
Gotestsum tool installation in CI and make
test/Makefile, .github/workflows/test.yaml
Add install-gotestsum and ensure-gotestsum targets; CI workflow installs gotestsum after Go setup.
Test timeout computation and gotestsum integration
test/Makefile
Define GOTESTSUM_CMD, compute GO_TIMEOUT from TIMEOUT with suffix parsing and a buffer, and run integration targets via gotestsum -timeout $(GO_TIMEOUT) with -run filters.
Kind cluster readiness timeout improvements
test/Makefile
Set kubectl wait timeouts for cnpg-controller-manager and cert-manager deployments to 300 seconds.
Remove legacy chart-testing make targets
Makefile
Deleted ct-lint and ct-install targets from the root Makefile.
Comprehensive test setup and execution documentation
test/README.md
Add documentation covering test types, OS-specific prerequisites, tooling installation (including gotestsum), and Make commands for running test subsets and chart-testing workflows.

Poem

I’m a rabbit with a test-run grin, 🐇
gotestsum counts each passing spin,
Timeouts stretched, clusters wait in line,
Docs show the steps, the garden’s fine — 🍃
Hooray for tests that finish on time!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: integrating gotestsum for test output formatting and adding comprehensive test documentation.
Description check ✅ Passed The description is directly related to the changeset, outlining the two primary objectives: replacing go test with gotestsum and adding documentation for running tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/PLAT-624/integrate-gotestsum-framework

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production

codacy-production Bot commented May 22, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/running-tests.md`:
- Around line 61-63: Replace the duplicated explicit go install lines in the
running-tests documentation with a single invocation of the Makefile target by
changing both occurrences of "go install gotest.tools/gotestsum@latest" to "make
-C test install-gotestsum" (as requested), and ensure the Linux section retains
the existing "sudo ln -sf $(go env GOPATH)/bin/gotestsum
/usr/local/bin/gotestsum" line since the Make target only performs the go
install; update the docs/running-tests.md text accordingly so both Mac
prerequisites and the Linux gotestsum section call the Make target instead of
running go install directly.

In `@test/Makefile`:
- Around line 67-69: The GO_TIMEOUT calculation incorrectly assumes TIMEOUT ends
with "m" and miscomputes values like "1h" or "90s"; replace the awk line that
sets GO_TIMEOUT with a small shell parser that inspects $(TIMEOUT), detects the
unit suffix (s,m,h or none), converts the value to a base unit (seconds or
minutes), adds a 10-minute (600s) buffer, and then formats GO_TIMEOUT in a
go-test-compatible duration (e.g., Xm or Xs or HmNs) before exporting it;
specifically, update the expression that sets GO_TIMEOUT to parse TIMEOUT,
handle cases for suffixes "s","m","h" (and a numeric default), perform the
arithmetic to add 600s, and produce a fallback default like "120m" on parse
failure so GO_TIMEOUT and TIMEOUT variables are consistent and safe for go test
-timeout.
- Around line 29-31: Create an ensure-gotestsum prerequisite that verifies
gotestsum is installed and invokes the existing install-gotestsum when missing
(e.g., use a shell check like `command -v gotestsum` and fall back to running
`$(MAKE) install-gotestsum`), then add ensure-gotestsum as a dependency for
every target that uses $(GOTESTSUM_CMD) (specifically test-install, test-nodes,
test-recovery, test-reset, test-failover and any other targets invoking
GOTESTSUM_CMD) so that attempting to run those targets on a fresh environment
triggers the installer instead of failing with "gotestsum: command not found".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 62006c2d-557c-489e-b9a3-3229f4bf60c9

📥 Commits

Reviewing files that changed from the base of the PR and between 2b10caf and e6dfcae.

📒 Files selected for processing (2)
  • docs/running-tests.md
  • test/Makefile

Comment thread test/README.md
Comment thread test/Makefile Outdated
Comment thread test/Makefile Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yaml:
- Around line 95-96: The CI step named "Install gotestsum" currently installs
gotestsum using go install gotest.tools/gotestsum@latest which makes the
workflow non-reproducible; update that step to pin the version by replacing the
`@latest` suffix with the stable release tag `@v1.13.0` so the workflow always
installs gotestsum v1.13.0.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74f46d47-1b84-488b-9a0a-260f9e55159c

📥 Commits

Reviewing files that changed from the base of the PR and between e6dfcae and a94de04.

📒 Files selected for processing (1)
  • .github/workflows/test.yaml

Comment thread .github/workflows/test.yaml Outdated

@mmols mmols left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. I left a few comments worth tidying to make the documentation complete and connect a few things together.

Comment thread test/README.md
Comment thread test/README.md
Comment thread test/README.md
Comment thread test/README.md
@usman-muzaffar555

Copy link
Copy Markdown
Member Author

Incorporated all the review comments

@mmols mmols left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM - take care of that one comment from CR and feel free to merge.

@usman-muzaffar555
usman-muzaffar555 merged commit f622fc8 into main Jun 2, 2026
5 checks passed
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