Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add unit tests for rpkg commands #84

Merged
merged 15 commits into from
Jul 22, 2024

Conversation

kushnaidu
Copy link
Contributor

This change introduces unit tests for most of the rpkg commands with slight modifications to the approve and reject commands to use the controller-runtime client instead of the rest interface.

@kushnaidu
Copy link
Contributor Author

/retest

Copy link
Member

Choose a reason for hiding this comment

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

Can you update the copyright notices on changed files please eg on this file

Copyright 2022,2024 The kpt and Nephio Authors

if err := v1alpha1.SchemeBuilder.AddToScheme(scheme); err != nil {
return err
}
func UpdatePackageRevisionApproval(ctx context.Context, client client.Client, key client.ObjectKey, new v1alpha1.PackageRevisionLifecycle) error {
Copy link
Member

@liamfallon liamfallon Jul 22, 2024

Choose a reason for hiding this comment

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

Nice refactoring on this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you :D

@@ -0,0 +1,190 @@
// Copyright 2022 The kpt and Nephio Authors
Copy link
Member

Choose a reason for hiding this comment

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

Can you change the date to 2024 on this and all the other unit test files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do that now Liam.

Copy link
Member

@liamfallon liamfallon left a comment

Choose a reason for hiding this comment

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

This is great, if you can just fix the copyright dates that wold be fine.

@liamfallon
Copy link
Member

Unit tests are passing for me locally.

Copy link
Member

@liamfallon liamfallon left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

Copy link
Contributor

nephio-prow bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kushnaidu, liamfallon

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

@nephio-prow nephio-prow bot added the approved label Jul 22, 2024
@nephio-prow nephio-prow bot merged commit 05ae047 into nephio-project:main Jul 22, 2024
5 checks passed
@kushnaidu kushnaidu deleted the rpkg-unit-test branch August 19, 2024 06:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants