test (controllers) : Dynamically construct envtest binary assets while preparing envtest environment (#1387)#1441
Merged
Conversation
…e preparing envtest environment Currently envtest environment is loaded with hardcoded BinaryAssetsDirectory for linux/amd64 machine. This doesn't work on other machines that have other operating systems and processor architectures. Updated `BinaryAssetsDirectory` to dynamically construct paths based on `runtime.GOOS` and `runtime.GOARCH` This change adds flexibility when running EnvTest across multiple platforms. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
|
Skipping CI for Draft Pull Request. |
Member
Author
|
/ok-to-test |
3 tasks
akurinnoy
approved these changes
Jun 4, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: akurinnoy, rohanKanojia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
I was facing this error when trying to run envtest on my macbook:
Test suite is hardcoded to look for binary assets for linux-amd64:
devworkspace-operator/controllers/controller/devworkspacerouting/suite_test.go
Line 89 in 1a65450
However, on my machine different binaries were downloaded by envtest:
Currently envtest environment is loaded with a hardcoded
BinaryAssetsDirectoryfor linux/amd64 machine. This doesn't work on other machines that have other operating systems and processor architectures.Updated
BinaryAssetsDirectoryto dynamically construct paths based onruntime.GOOSandruntime.GOARCHThis change adds flexibility when running EnvTest across multiple platforms.
What issues does this PR fix or reference?
Fix #1387
Is it tested? How?
I've verified that
make testis working.PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-pathto trigger)v8-devworkspace-operator-e2e: DevWorkspace e2e testv8-che-happy-path: Happy path for verification integration with Che