-
Notifications
You must be signed in to change notification settings - Fork 187
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
[full-ci] Delete resharing tests #8704
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Change: Disable resharing by default for deprecation | ||
|
||
We disabled the resharing feature by default. This feature will be removed from the product in the next major release. The resharing feature is not recommended for use and should be disabled. Existing reshares will continue to work. | ||
|
||
https://github.com/owncloud/ocis/pull/8653 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -731,36 +731,37 @@ var _ = Describe("Driveitems", func() { | |
_, ok := res.GetExpirationDateTimeOk() | ||
Expect(ok).To(BeFalse()) | ||
}) | ||
It("updates the share permissions with changing the role", func() { | ||
getPublicShareMockResponse.Share = nil | ||
getPublicShareMockResponse.Status = status.NewNotFound(ctx, "not found") | ||
updateShareMock := gatewayClient.On("UpdateShare", | ||
mock.Anything, | ||
mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool { | ||
return req.GetShare().GetId().GetOpaqueId() == "permissionid" | ||
}), | ||
) | ||
updateShareMock.Return(updateShareMockResponse, nil) | ||
|
||
driveItemPermission.SetRoles([]string{unifiedrole.NewViewerUnifiedRole(true).GetId()}) | ||
body, err := driveItemPermission.MarshalJSON() | ||
Expect(err).To(BeNil()) | ||
svc.UpdatePermission( | ||
rr, | ||
httptest.NewRequest(http.MethodPatch, "/", strings.NewReader(string(body))). | ||
WithContext(ctx), | ||
) | ||
Expect(rr.Code).To(Equal(http.StatusOK)) | ||
data, err := io.ReadAll(rr.Body) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
res := libregraph.Permission{} | ||
|
||
err = json.Unmarshal(data, &res) | ||
Expect(err).ToNot(HaveOccurred()) | ||
_, ok := res.GetRolesOk() | ||
Expect(ok).To(BeTrue()) | ||
}) | ||
// that is resharing test. Please delete after disable resharing feature | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to merge the PR with that commented code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, we want to delete all resharing code and all resharing unit tests after merging this PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commented out code will be removed in following PRs |
||
|
||
// It("updates the share permissions with changing the role", func() { | ||
// getPublicShareMockResponse.Share = nil | ||
// getPublicShareMockResponse.Status = status.NewNotFound(ctx, "not found") | ||
// updateShareMock := gatewayClient.On("UpdateShare", | ||
// mock.Anything, | ||
// mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool { | ||
// return req.GetShare().GetId().GetOpaqueId() == "permissionid" | ||
// }), | ||
// ) | ||
// updateShareMock.Return(updateShareMockResponse, nil) | ||
// driveItemPermission.SetRoles([]string{unifiedrole.NewViewerUnifiedRole(false).GetId()}) | ||
// body, err := driveItemPermission.MarshalJSON() | ||
// Expect(err).To(BeNil()) | ||
// svc.UpdatePermission( | ||
// rr, | ||
// httptest.NewRequest(http.MethodPatch, "/", strings.NewReader(string(body))). | ||
// WithContext(ctx), | ||
// ) | ||
// Expect(rr.Code).To(Equal(http.StatusOK)) | ||
// data, err := io.ReadAll(rr.Body) | ||
// Expect(err).ToNot(HaveOccurred()) | ||
|
||
// res := libregraph.Permission{} | ||
|
||
// err = json.Unmarshal(data, &res) | ||
// Expect(err).ToNot(HaveOccurred()) | ||
// _, ok := res.GetRolesOk() | ||
// Expect(ok).To(BeTrue()) | ||
// }) | ||
It("fails to update the share permissions for a file share when setting a space specific role", func() { | ||
getPublicShareMockResponse.Share = nil | ||
getPublicShareMockResponse.Status = status.NewNotFound(ctx, "not found") | ||
|
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.
I would suggest to leave it pinned to a particular version
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.
owncloud/owncloud-test-middleware#143 (comment)