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

[Tests-Only] add tests for sharing the shares_folder #38780

Merged
merged 1 commit into from
May 27, 2021

Conversation

dpakach
Copy link
Contributor

@dpakach dpakach commented May 26, 2021

Description

Add API test for sharing the shares_folder

Related Issue

Motivation and Context

How Has This Been Tested?

🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
Then as "Brian" file "Shares/textfile0.txt" should exist
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need a then step without a when step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is a case where we expect the sharing to fail, I think its good to make sure that the file actually exists before sharing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then, Maybe a step like the following would be better.??

Suggested change
Then as "Brian" file "Shares/textfile0.txt" should exist
And as user "Brian" file "Shares/textfile0.txt" exists

Copy link
Contributor

Choose a reason for hiding this comment

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

The test code for
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
checks that the HTTP status code is 200.
We believe that in other places in the test suite - that an ordinary accept of a share means that Brian now has a received shared file like Shares/texfile0.txt. And there are other tests for accepting shares that would fail if the given steps here do not work.

Maybe delete this extra Then check?

And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
Then as "Brian" file "Shares/textfile0.txt" should exist
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
Then as "Brian" file "Shares/textfile0.txt" should exist
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@dpakach
Copy link
Contributor Author

dpakach commented May 26, 2021

Current Behavior

on oc10

it gives 403 with the following body

        │ <ocs>
        │  <meta>
        │   <status>failure</status>
        │   <statuscode>403</statuscode>
        │   <message>Path contains files shared with you</message>
        │   <totalitems></totalitems>
        │   <itemsperpage></itemsperpage>
        │  </meta>
        │  <data/>
        │ </ocs>

on ocis

it gives 403 with the following body

<ocs><meta><status>error</status><statuscode>996</statuscode><message>error sending a grpc create share request</message></meta></ocs>

@dpakach dpakach force-pushed the share-shares-folder branch from 676b89a to a4060cf Compare May 27, 2021 07:43
@dpakach dpakach requested a review from jasson99 May 27, 2021 07:46
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@jasson99 jasson99 left a comment

Choose a reason for hiding this comment

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

LGTM

@jasson99 jasson99 dismissed their stale review May 27, 2021 10:06

stale

@phil-davis phil-davis merged commit de84306 into master May 27, 2021
@delete-merged-branch delete-merged-branch bot deleted the share-shares-folder branch May 27, 2021 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants