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

Deployment unit tests #646

Merged
merged 3 commits into from
Dec 21, 2018

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Dec 18, 2018

What this PR does / why we need it:
Initial PR to increase test coverage for machineDeployment controller

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

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

Release note:


@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 18, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @enxebre. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 18, 2018
@@ -50,7 +50,7 @@ var stateConfirmationInterval = 100 * time.Millisecond
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
r := newReconciler(mgr)
return add(mgr, r, r.MachineSetToMachines)
return add(mgr, r, r.MachineToMachineSets)
Copy link
Member Author

Choose a reason for hiding this comment

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

@scruplelesswizard
Copy link

/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 Dec 18, 2018
},
}
controller := true
ms := v1alpha1.MachineSet{

Choose a reason for hiding this comment

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

Given that we enumerate the other instances (ms2, ms3), why not make this ms1?

machineDeployment,
},
}
ms := v1alpha1.MachineSet{

Choose a reason for hiding this comment

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

Given that we enumerate the others, why not make this ms1?

@enxebre enxebre force-pushed the deployment-unit-tests branch from 543335a to 4f6c5e6 Compare December 18, 2018 17:42
@roberthbailey
Copy link
Contributor

/assign @frobware

@k8s-ci-robot
Copy link
Contributor

@roberthbailey: GitHub didn't allow me to assign the following users: frobware.

Note that only kubernetes-sigs members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

/assign @frobware

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.

@frobware
Copy link

LGTM @roberthbailey

@enxebre enxebre force-pushed the deployment-unit-tests branch from 4f6c5e6 to 2b9bcd1 Compare December 20, 2018 13:06
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 20, 2018
@enxebre
Copy link
Member Author

enxebre commented Dec 20, 2018

/test pull-cluster-api-test

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

Only some minor comments.

/lgtm

},
},
}
err := r.Client.List(context.Background(), listOptions, machineSets)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

The above could be simplified with if err := ...; err != nil {.

},
},
}
err := r.Client.List(context.Background(), listOptions, dList)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, can be simplified with if err := ...; err != nil {.

@@ -230,7 +252,7 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach
return nil, err
}
machines := &v1alpha1.MachineList{}
err = r.List(context.Background(), client.InNamespace(d.Namespace).MatchingLabels(selector), machines)
err = r.Client.List(context.Background(), client.InNamespace(d.Namespace).MatchingLabels(selector), machines)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Should we use client.ListOptions here? Mostly to be consistent.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 20, 2018
@roberthbailey
Copy link
Contributor

/approve
/hold

Please remove the hold once all comments have been addressed.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre, roberthbailey

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Dec 21, 2018
@enxebre enxebre force-pushed the deployment-unit-tests branch from 3024092 to f6010da Compare December 21, 2018 11:10
@k8s-ci-robot k8s-ci-robot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 21, 2018
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 21, 2018
@enxebre enxebre force-pushed the deployment-unit-tests branch from f6010da to bcd3145 Compare December 21, 2018 11:12
@enxebre
Copy link
Member Author

enxebre commented Dec 21, 2018

thanks all for having a look, all comments addressed now

@enxebre enxebre force-pushed the deployment-unit-tests branch from bcd3145 to f2552c9 Compare December 21, 2018 11:18
@enxebre
Copy link
Member Author

enxebre commented Dec 21, 2018

/test pull-cluster-api-test

@scruplelesswizard
Copy link

/lgtm
Reiterate lgtm as all changes have been made as requested

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2018
@scruplelesswizard
Copy link

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 21, 2018
@k8s-ci-robot k8s-ci-robot merged commit d19e6b6 into kubernetes-sigs:master Dec 21, 2018
jayunit100 pushed a commit to jayunit100/cluster-api that referenced this pull request Jan 31, 2020
…st-k8s-versions

only document latest Kubernetes patch versions
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

6 participants