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

add a bit more tests for CRD #189

Merged
merged 1 commit into from
Apr 13, 2019

Conversation

mengqiy
Copy link
Member

@mengqiy mengqiy commented Apr 13, 2019

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 13, 2019
@k8s-ci-robot k8s-ci-robot requested review from droot and pwittrock April 13, 2019 00:32
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 13, 2019
@mengqiy
Copy link
Member Author

mengqiy commented Apr 13, 2019

/cc @redborian

@k8s-ci-robot
Copy link
Contributor

@mengqiy: GitHub didn't allow me to request PR reviews from the following users: redborian.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @redborian

Instructions 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/test-infra repository.

},
expectedCrdSpecs: map[schema.GroupKind][]byte{
schema.GroupKind{Group: "foo.bar.com", Kind: "Toy"}: []byte(`group: foo.bar.com
names:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, if we need to write more tests, we can think about having these in their own separate yaml files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, the best practice is that "unit tests should not access filesystem".
Echo some benefits mentioned in https://github.com/spf13/afero#using-afero-for-testing

Much faster than performing I/O operations on disk
Avoid security issues and permissions
Far more control. 'rm -rf /' with confidence
Test setup is far more easier to do
No test cleanup needed

We can revisit this if it grow to too large.

Copy link
Contributor

@redborian redborian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mengqiy mengqiy added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Apr 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: mengqiy

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 647e7c5 into kubernetes-sigs:crdgenerator Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants