Skip to content
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

Golden files test is broken #1003

Closed
mengqiy opened this issue Sep 19, 2019 · 3 comments · Fixed by #1107
Closed

Golden files test is broken #1003

mengqiy opened this issue Sep 19, 2019 · 3 comments · Fixed by #1107
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@mengqiy
Copy link
Member

mengqiy commented Sep 19, 2019

kubebuilder has a test to ensure the files under /testdata always reflects what is generated. Test will fail if /testdata is out of date.
But it seems to be broken now. See: #983 (review)

/kind bug

@mengqiy mengqiy added the kind/bug Categorizes issue or PR as related to a bug. label Sep 19, 2019
@DirectXMan12
Copy link
Contributor

/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 19, 2019
@mengqiy
Copy link
Member Author

mengqiy commented Sep 19, 2019

It seems golden file test doesn't cover v2 scaffolding and it's brittle.
The test requires explicitly specifying which files should be covered. And then check if they match.
If a file is not specified or the /testdata directory has more files than what are generated, the test can't catch it.

IMO the test should be generating the scaffolding using the new kubebuilder and diff it against the golden files. It's simpler and more robust.

e.g. test files: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/scaffold/v1/manager/manager_test.go

@DirectXMan12
Copy link
Contributor

SGTM

@mengqiy mengqiy added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants