Remove setup-envtest if different arch during make test#2152
Remove setup-envtest if different arch during make test#2152kaovilai wants to merge 1 commit intoopenshift:oadp-devfrom
make test#2152Conversation
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughModified the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR aims to make make test more reliable by automatically cleaning up an incompatible setup-envtest binary that may have been written into the shared bin/ directory by a container build targeting a different architecture.
Changes:
- Adds a pre-check in the
setup-envtestinstallation rule to remove an existingsetup-envtestbinary if it can’t be executed on the current platform. - Documents the cross-architecture scenario that can cause
make testfailures due to a non-native binary inbin/.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .PHONY: envtest | ||
| envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. | ||
| $(ENVTEST): $(LOCALBIN) | ||
| @if [ -f $(ENVTEST) ] && ! $(ENVTEST) --help >/dev/null 2>&1; then \ | ||
| echo "Removing incompatible setup-envtest binary"; \ | ||
| rm -f $(ENVTEST); \ | ||
| fi | ||
| $(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20250308055145-5fe7bb3edc86) |
There was a problem hiding this comment.
The incompatibility check is inside the $(ENVTEST) file target recipe, but that recipe won’t run when $(ENVTEST) already exists and is considered up-to-date. In the exact scenario this PR describes (a wrong-arch bin/setup-envtest already present), make test will usually skip this recipe and the bad binary won’t be removed. Consider making the compatibility check run unconditionally (e.g., move the check into the .PHONY: envtest target, or add a phony FORCE prerequisite to $(ENVTEST) so the recipe always executes; go-install-tool already avoids re-installing when the file is present).
|
@kaovilai: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
Signed-off-by: Tiger Kaovilai tkaovila@redhat.com
Why the changes were made
How to test the changes made