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 Test for getting bool from service annotation #2410

Merged

Conversation

FavourEva
Copy link
Contributor

@FavourEva FavourEva commented Oct 9, 2023

What this PR does / why we need it:
Add unit test for getting bool from service annotation

Special notes for reviewers:
To run the test, on your terminal run make unit

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 9, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @FavourEva. Thanks for your PR.

I'm waiting for a 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 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 Oct 9, 2023
@dulek
Copy link
Contributor

dulek commented Oct 9, 2023

/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 Oct 9, 2023
@dulek
Copy link
Contributor

dulek commented Oct 9, 2023

/approve

Looks good, let's see if tests pass.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2023
@dulek
Copy link
Contributor

dulek commented Oct 9, 2023

The code seems to still be formatted incorrectly. You should be able to check that before submitting running make check from the repo.

@FavourEva
Copy link
Contributor Author

/retest

@FavourEva
Copy link
Contributor Author

/retest

Error's unrelated.

@FavourEva
Copy link
Contributor Author

/retest

1 similar comment
@FavourEva
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 10, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dulek

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 10, 2023
@FavourEva FavourEva force-pushed the testgetboolfromserviceannotation branch 3 times, most recently from 1f9a6d4 to 85bb100 Compare October 10, 2023 22:51
@FavourEva FavourEva changed the title testgetboolfromserviceannotation [Cloud Provider Openstack] Add Test for getting bool from service annotation Oct 10, 2023
@pierreprinetti
Copy link
Member

/assign

Copy link
Member

@pierreprinetti pierreprinetti left a comment

Choose a reason for hiding this comment

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

Your test looks good. Thanks!

If you have a bit more time, have another look at the production code. Do you see something strange? In particular: do you think logging could be improved?

@pierreprinetti
Copy link
Member

/lgtm
...but you'll have to rebase to enable merging.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 11, 2023
@FavourEva
Copy link
Contributor Author

Your test looks good. Thanks!

If you have a bit more time, have another look at the production code. Do you see something strange? In particular: do you think logging could be improved?

The production code currently do not log errors when an invalid annotation is encountered in the annotation. We could add error logging when the annotation is neither true or false to improve robustness. This would also help in debugging issues where annotation value is unexpected.

Is this what you see strange in the production code? or there's something else @pierreprinetti

@FavourEva FavourEva force-pushed the testgetboolfromserviceannotation branch from 85bb100 to 695456d Compare October 11, 2023 21:17
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 11, 2023
@kayrus
Copy link
Contributor

kayrus commented Oct 11, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 11, 2023
@FavourEva
Copy link
Contributor Author

/lgtm ...but you'll have to rebase to enable merging.

Just fixed that. Thanks

@k8s-ci-robot k8s-ci-robot merged commit 20e7187 into kubernetes:master Oct 11, 2023
@pierreprinetti
Copy link
Member

Your test looks good. Thanks!
If you have a bit more time, have another look at the production code. Do you see something strange? In particular: do you think logging could be improved?

The production code currently do not log errors when an invalid annotation is encountered in the annotation. We could add error logging when the annotation is neither true or false to improve robustness. This would also help in debugging issues where annotation value is unexpected.

Is this what you see strange in the production code? or there's something else @pierreprinetti

This is precisely what I saw. If a non-boolean annotation is found, we log "Found a service annotation:" and then the default setting, which is not what happened. Do you want to fix that?

@FavourEva
Copy link
Contributor Author

Your test looks good. Thanks!
If you have a bit more time, have another look at the production code. Do you see something strange? In particular: do you think logging could be improved?

The production code currently do not log errors when an invalid annotation is encountered in the annotation. We could add error logging when the annotation is neither true or false to improve robustness. This would also help in debugging issues where annotation value is unexpected.
Is this what you see strange in the production code? or there's something else @pierreprinetti

This is precisely what I saw. If a non-boolean annotation is found, we log "Found a service annotation:" and then the default setting, which is not what happened. Do you want to fix that?

Sure, would fix that right away. Thanks

mandre pushed a commit to shiftstack/cloud-provider-openstack that referenced this pull request Feb 6, 2024
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. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants