-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: add tc for limited guest of a project to get repository #20311
Conversation
Signed-off-by: Shengwen Yu <[email protected]>
512c0dd
to
b2e78f3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20311 +/- ##
===========================================
- Coverage 67.56% 46.28% -21.29%
===========================================
Files 991 247 -744
Lines 109181 13750 -95431
Branches 2719 2827 +108
===========================================
- Hits 73768 6364 -67404
+ Misses 31449 7062 -24387
+ Partials 3964 324 -3640
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#3. Add user(UA) as a member of project(PA) with "Limited Guest" role; | ||
with created_project(metadata={"public": "false"}, user_id=user_id, member_role_id=5) as (project_id, project_name): | ||
#4. Push an image to project(PA) by user(UA), then check the project quota usage; | ||
image, tag = "goharbor/alpine", "3.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can define these variables in setUp.
#6. Delete repository(RA) | ||
self.repository.delete_repository(project_name, "goharbor%2Falpine", **ADMIN_CLIENT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this step should be in tearDown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it has to be within the with created_project
, otherwise with created_project
cannot delete the project itself because there is repository within the project to be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #19878
Please indicate you've done the following: