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

🌱 Release Notes Generator - Test cases for main.go and ref.go #11882

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

irapandey
Copy link
Contributor

@irapandey irapandey commented Feb 20, 2025

What this PR does / why we need it:
This PR adds unit tests for release note generator to add more coverage to non-covered functions

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 #
This PR partially fixes #11368
Will raise small PRs to make review easier

/area testing

Screenshot 2025-02-20 at 6 21 54 PM

@k8s-ci-robot k8s-ci-robot added area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 20, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @irapandey!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. 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 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
Copy link
Contributor

Hi @irapandey. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 20, 2025
@irapandey irapandey changed the title Release Notes Generator - Test cases for main.go and ref.go 🌱 Release Notes Generator - Test cases for main.go and ref.go Feb 20, 2025
@irapandey
Copy link
Contributor Author

@chandankumar4 - Can you take a look here please

@irapandey irapandey force-pushed the test_case_release_note_generator branch from 73540ca to 7c90cb5 Compare February 27, 2025 04:58
@sbueringer
Copy link
Member

/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 Feb 27, 2025
@chandankumar4
Copy link
Contributor

/assign chandankumar4

@irapandey irapandey force-pushed the test_case_release_note_generator branch from dd96f47 to 5c63dc9 Compare March 2, 2025 11:27
Copy link
Contributor

@chandankumar4 chandankumar4 left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks

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

LGTM label has been added.

Git tree hash: e0e128671fa7e8b466ea91d29b477196b8f27802

@chandankumar4
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chandankumar4
Once this PR has been reviewed and has the lgtm label, please assign mboersma for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@sbueringer
Copy link
Member

You'll need an approve from a maintainer. It's in my queue, just not highest priority considering we are 2 weeks away from code freeze :)

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

Some improvements :-)

newTag: "v1.0.0",
},
wantErr: false,
},
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a case which sets branch instead of fromRef

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we talking about something on these lines?

{
  name: "Missing fromRef when newTag is set",
  args: &notesCmdConfig{
  branch: "main",
  toRef:   "ref2/tags",
  newTag:  "v1.0.0",
  },
  wantErr: false,
},

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Member

Choose a reason for hiding this comment

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

But more:

{
  name: "Missing branch when newTag is set",
  args: &notesCmdConfig{
  branch: "main",
  toRef:   "ref2/tags",
  newTag:  "v1.0.0",
  },
  wantErr: false,
},

Copy link
Member

Choose a reason for hiding this comment

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

or doesn't this make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup - this does look better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but if it's missing branch, we shouldn't be setting branch(leave it blank)
We already have this when branch is not set

{
  name: "Valid fromRef, toRef, and newTag",
  args: &notesCmdConfig{
    fromRef: "ref1/tags",
    toRef:   "ref2/tags",
    newTag:  "v1.0.0",
  },
  wantErr: false,
},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it expected to set branch using the toRef and fromRef?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@irapandey irapandey force-pushed the test_case_release_note_generator branch from 60b0d51 to 1a752b4 Compare March 7, 2025 09:29
@irapandey irapandey force-pushed the test_case_release_note_generator branch from 1a752b4 to 3212ba5 Compare March 10, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

Add test cases for improving test coverage of release notes tools generator
5 participants