-
Notifications
You must be signed in to change notification settings - Fork 209
be able to run defaulter-gen tests via go test
#245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Files whose names begin with "_" are ignored by go test so none of the defaulter-gen tests were running in CI. This commit renames `_output_tests` to `output_tests` so that tests are run. After doing so, tests failed because some packages missed a `fake_deepcopy_conversion.go` file. This is necessary because types registered in the scheme need to implement the `DeepCopyObject()` method. Additionally, some of the tests import `k8s.io/api` and `k8s.io/apimachinery` so these are also added to `go.mod`.
go testgo test
go testgo test
|
/cc @sttts |
apelisse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's definitely confusing. Can we get a comment somewhere to indicate what's going on without having to go through the github history?
|
updated PR description and added comment |
|
/label tide/merge-method-squash |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, apelisse, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Continuation of #240 which went stale and closed.
Took into account some of the feedback provided on that PR, keeping
_output-testsbut adding its own go.mod so there can be a dependency on k/k packages directly without forming a cycle.Changes from initial PR:
output_testsback to_output_tests_output_teststooutput_tests- otherwise retaining underscore in go package name caused ambiguous import error with gengo's file tree:The module name itself still needed the underscore removed otherwise would get this error:
I think since this PR adds a new go module CI would need to be updated to run it. This PR makes
go test ./...from within_output_testscorrectly run without hacks.