Skip to content

fix: gotestsum instllation before running tests#5206

Open
nestoracunablanco wants to merge 1 commit into
openshift:mainfrom
nestoracunablanco:fix/makeUnitTests
Open

fix: gotestsum instllation before running tests#5206
nestoracunablanco wants to merge 1 commit into
openshift:mainfrom
nestoracunablanco:fix/makeUnitTests

Conversation

@nestoracunablanco
Copy link
Copy Markdown

@nestoracunablanco nestoracunablanco commented May 27, 2026

Install gotestsum before running tests to ensure the test tooling is available.

Summary

This PR ensures the test tooling gotestsum is installed before running tests by adding an explicit installation step in the Makefile. Both the test (unit) and e2e targets now run go install gotest.tools/gotestsum@latest before invoking the test runner script (hack/test-go.sh).

Impact

  • Component affected: local/CI test invocation for ci-tools (Makefile targets used by developers and CI).
  • For developers: Running make test will automatically install gotestsum if it's missing, preventing "command not found" failures and smoothing local test execution.
  • For CI operators: make e2e invoked by CI jobs will now guarantee gotestsum is present before executing end-to-end test suites, ensuring consistent test output formatting and jUnit report generation for artifact collection.

Changes

  • Makefile: added go install gotest.tools/gotestsum@latest as a pre-step in the test and e2e targets. The calls to hack/test-go.sh remain unchanged.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci Bot requested review from hector-vido and smg247 May 27, 2026 11:36
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nestoracunablanco
Once this PR has been reviewed and has the lgtm label, please assign smg247 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e9f43ed7-6e10-44fa-878e-caa1392dd70b

📥 Commits

Reviewing files that changed from the base of the PR and between 2839c56 and a3d73d1.

📒 Files selected for processing (1)
  • Makefile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile

📝 Walkthrough

Walkthrough

The test and e2e Makefile targets now run go install gotest.tools/gotestsum@latest immediately before invoking the existing hack/test-go.sh test script.

Changes

Test Tooling Setup

Layer / File(s) Summary
Install gotestsum in test and e2e targets
Makefile
Both test (lines 50-55) and e2e (lines 141-146) targets add go install gotest.tools/gotestsum@latest immediately before calling hack/test-go.sh.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 17
✅ Passed checks (17 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions installing gotestsum before running tests, which matches the PR's main objective, but contains a typo ('instllation' instead of 'installation').
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.
Go Error Handling ✅ Passed The PR changes only the Makefile to install gotestsum before tests. The "Go Error Handling" check applies to Go source code, not build scripts or tool installation commands.
Test Coverage For New Features ✅ Passed PR only modifies Makefile to install gotestsum before tests. This is a configuration-only change with no new Go functions, methods, or application logic that would require test coverage.
Stable And Deterministic Test Names ✅ Passed PR only installs gotestsum in Makefile and removes unused mock methods; no Ginkgo test definitions are added, modified, or removed, so the check does not apply.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code. Modified test files are standard Go unit tests with only minor mock method removals, making the Ginkgo quality check inapplicable.
Microshift Test Compatibility ✅ Passed PR modifies only the Makefile to add gotestsum installation; no new Ginkgo e2e tests are added, so the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR only modifies the Makefile to install gotestsum before running tests; it adds no new Ginkgo e2e tests, so the SNO test compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed PR only modifies Makefile test targets to install gotestsum; no deployment manifests, operator code, or scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed PR only modifies Makefile to install gotestsum before tests; no Go code changes introduce stdout writes in process-level code that would violate OTE contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only modifies Makefile to install gotestsum before tests. No new Ginkgo e2e tests are added, so the IPv6/disconnected network compatibility check does not apply.
No-Weak-Crypto ✅ Passed PR changes test infrastructure and GSM refactoring with no weak crypto patterns detected (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or non-constant-time comparisons).
Container-Privileges ✅ Passed PR modifies only Makefile and Go source files; no container or K8s manifests changed, making this container-privileges check not applicable.
No-Sensitive-Data-In-Logs ✅ Passed PR adds 'go install gotest.tools/gotestsum@latest' to test and e2e targets. No passwords, tokens, API keys, PII, or sensitive data are exposed in the logging.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 27, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

Hi @nestoracunablanco. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Makefile (1)

144-144: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add gotestsum install to the e2e target (it calls hack/test-go.sh which requires it).

hack/test-go.sh runs gotestsum directly (Makefile hack/test-go.sh line 11) but only the test target installs gotest.tools/gotestsum@latest. make e2e currently calls hack/test-go.sh without installing gotestsum, so it can fail when gotestsum isn’t already present.

🔧 Proposed fix
e2e: $(TMPDIR)/.boskos-credentials
+	go install gotest.tools/gotestsum@latest
 	BOSKOS_CREDENTIALS_FILE="$(TMPDIR)/.boskos-credentials" PACKAGES="$(PACKAGES)" TESTFLAGS="$(TESTFLAGS) -tags $(TAGS) -timeout 70m -parallel 100" hack/test-go.sh
🤖 Prompt for 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.

In `@Makefile` at line 144, The e2e Makefile target calls hack/test-go.sh which
expects gotestsum to be installed but e2e doesn’t install it; update the e2e
target (the rule invoking hack/test-go.sh) to install gotestsum the same way the
test target does (e.g., run the go install gotest.tools/gotestsum@latest step)
before calling hack/test-go.sh so hack/test-go.sh can use gotestsum reliably;
reference the Makefile e2e target and hack/test-go.sh when making the change.
🤖 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.

Outside diff comments:
In `@Makefile`:
- Line 144: The e2e Makefile target calls hack/test-go.sh which expects
gotestsum to be installed but e2e doesn’t install it; update the e2e target (the
rule invoking hack/test-go.sh) to install gotestsum the same way the test target
does (e.g., run the go install gotest.tools/gotestsum@latest step) before
calling hack/test-go.sh so hack/test-go.sh can use gotestsum reliably; reference
the Makefile e2e target and hack/test-go.sh when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9bb6d2ab-83fe-4c7e-9b82-d8ea566e8521

📥 Commits

Reviewing files that changed from the base of the PR and between 628dff0 and 2839c56.

📒 Files selected for processing (1)
  • Makefile

Install gotestsum before running tests to ensure the test tooling
is available.

Signed-off-by: nestoracunablanco <nestor.acuna@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant