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 unit tests for VM converter and remove unused err from SDKToVM #2564

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

willie-yao
Copy link
Contributor

@willie-yao willie-yao commented Aug 15, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds unit tests for the VM converter and removes unused err return from SDKToVM

Which issue(s) this PR fixes:
Fixes #2538

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 15, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 15, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: willie-yao / name: William Yao (01ac161)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 15, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @willie-yao!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 15, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @willie-yao. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 15, 2022
@mboersma
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 15, 2022
@willie-yao
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 18, 2022
@willie-yao willie-yao marked this pull request as ready for review August 18, 2022 23:17
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 18, 2022
@willie-yao willie-yao force-pushed the add-vm-converter-test branch from 85dd8cc to 77fc7fc Compare August 18, 2022 23:19
@willie-yao
Copy link
Contributor Author

/retest

@willie-yao willie-yao force-pushed the add-vm-converter-test branch from 458392d to 20b71b7 Compare August 19, 2022 20:43
@Jont828
Copy link
Contributor

Jont828 commented Aug 19, 2022

By the way since the VM converter never actually returns an error I think could probably just remove it from the function spec. Wdyt about that?

@willie-yao
Copy link
Contributor Author

I agree with that. Should we do that in a separate PR?

@mboersma
Copy link
Contributor

the VM converter never actually returns an error...just remove it from the spec

Should we do that in a separate PR?

My test for that is "is there a possibility we might need to revert these changes separately?" That illuminates whether the changes are logically distinct and ought to have separate commits and PRs.

In this case, the changes are distinct, but I think there's little chance we would need to revert them separately. So IMHO it's a judgment call. It's always defensible to make separate PRs, but I think you could make both changes in one PR in this case and reviewers wouldn't complain...at least I wouldn't. 😄

This lgtm, btw.

@willie-yao
Copy link
Contributor Author

willie-yao commented Aug 22, 2022

@mboersma @Jont828 Just pushed changes removing the unused err from SDKToVM. Let me know if this looks good, and I'll squash it. I figured I'd include it in this PR since it changes the test somewhat significantly.

@willie-yao willie-yao changed the title Add unit tests for VM converter Add unit tests for VM converter and remove unused err from SDKToVM Aug 22, 2022
@mboersma
Copy link
Contributor

Hmm...so changing the signature of SDKToVM is actually a public-facing API change, so apidiff is correct. I think it's entirely likely that no one is consuming that API beyond the single reference that you updated in this PR, but we can't be sure.

Maybe I was wrong about combining the two commits? I'm curious what other reviewers think. ping @Jont828 @CecileRobertMichon @jackfrancis

@willie-yao
Copy link
Contributor Author

@mboersma That's correct. One interesting thing is that my PR to change the apidiff test would have made this test pass, since we are changing that test to only flag breaking changes within the api/ or exp/api/ directories. I'm assuming this means that this change would be okay to merge?

@mboersma
Copy link
Contributor

You are correct, I totally forgot that we really only care about those dirs for apidiff. (#2567 can't merge soon enough.)

@mboersma
Copy link
Contributor

@willie-yao if you can rebase this to fix the apidiff error, I think it's good to merge.

@willie-yao willie-yao force-pushed the add-vm-converter-test branch from fb6cd59 to 8b53f68 Compare August 23, 2022 16:43
Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 23, 2022
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

great work 🎉

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 23, 2022
@k8s-ci-robot k8s-ci-robot merged commit 997b40a into kubernetes-sigs:main Aug 23, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Aug 23, 2022
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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.

Add unit tests for VM converter
5 participants