🐛 Fix TestParseSubscriptionConfig to work with vendor mode#2466
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2466 +/- ##
=======================================
Coverage 69.50% 69.50%
=======================================
Files 102 102
Lines 8231 8231
=======================================
Hits 5721 5721
Misses 2057 2057
Partials 453 453
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grokspawn 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 |
46f9978
into
operator-framework:main
Description
To address openshift/operator-framework-operator-controller#615 (comment)
The
getModulePathhelper function usesgo list -mod=readonlyto find module paths from the Go module cache. This works in development environments but fails invendormode builds where:-mod=readonlyflag bypasses the vendor directoryThis causes the test to fail with:
open pkg/operators/v1alpha1/subscription_types.go: no such file or directoryUpdate
getModulePathto first check for the module in the vendor directory before falling back to the Go module cache. This ensures the test works in both:Modified
getModulePathinhack/tools/schema-generator/main_test.goto:1. Check if module exists in
vendor/<module-path>2. Check relative path from test directory (
../../../vendor/<module-path>)3. Fall back to
go list -mod=readonlyfor module cache lookupReviewer Checklist