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

Add version restore tests when sharee has moved the shared folder or file #31680

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jun 7, 2018

Description

Add test cases for when a sharee receives a file or folder, then moves that file or folder and then tries to restore old versions.

Refactor some existing tests to check the version recovery a bit more cleanly.

Related Issue

#31681

Motivation and Context

Some issues have been reported when the sharee (receiver of a shared file or folder) moves the received share, then tries to restore an old version. Make some tests to check this behavior.

How Has This Been Tested?

Local API acceptance test run

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • acceptance test enhancement

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

And user "user1" has been created
And user "user0" has uploaded file with content "old content" to "/sharefile.txt"
And user "user0" has uploaded file with content "new content" to "/sharefile.txt"
And user "user0" has shared file "/sharefile.txt" with user "user1"
Copy link
Contributor

Choose a reason for hiding this comment

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

@phil-davis please add another scenario where the source shared file is in "/outgoing/sharefile.txt" and where "outgoing/sharefile.txt" is shared with "user1". This would match the steps from #31681

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done - that scenario also passes. so I expect this stuff is OK in master for things that use these endpoints.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it is ok on master and also my manual test doesn't reproduce the issue on stable10 backport of object store: #31050

let's merge this PR and backport it then

@phil-davis phil-davis force-pushed the restore-file-from-moved-location branch from 006d530 to 06350c2 Compare June 7, 2018 14:22
@codecov
Copy link

codecov bot commented Jun 7, 2018

Codecov Report

Merging #31680 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #31680   +/-   ##
=========================================
  Coverage     62.89%   62.89%           
  Complexity    18418    18418           
=========================================
  Files          1154     1154           
  Lines         69157    69157           
  Branches       1260     1260           
=========================================
  Hits          43499    43499           
  Misses        25289    25289           
  Partials        369      369
Flag Coverage Δ Complexity Δ
#javascript 52.39% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.1% <ø> (ø) 18418 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 649c57c...06350c2. Read the comment docs.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 please backport

@phil-davis phil-davis merged commit 6644cfc into master Jun 7, 2018
@phil-davis phil-davis deleted the restore-file-from-moved-location branch June 7, 2018 15:08
@phil-davis
Copy link
Contributor Author

Backported to #31050 object store changes

@PVince81
Copy link
Contributor

PVince81 commented Jun 7, 2018

@phil-davis can you also put them in a temp PR directly to stable10 to confirm the test will fail ? (or run it locally)

@phil-davis
Copy link
Contributor Author

I will look and see what test step code is needed out of the object-store backport, and if the used endpoints work in "raw" stable10 ...
(I am not sure how it came to be that the whole dav-versions.feature file ended up in that object-store backport)

@PVince81
Copy link
Contributor

PVince81 commented Jun 7, 2018

(I am not sure how it came to be that the whole dav-versions.feature file ended up in that object-store backport)

@phil-davis I think dav-versions never existed before and got written from scratch for the object store part, because object store work provided new API endpoints for versions. So the tests in questions (at least the steps) can only work with that API endpoint, which is also provided somewhere in this PR.

We cannot easily move that directly to stable10 without rewriting the steps to use the old private APIs... so better leave it here where it belongs.

@phil-davis
Copy link
Contributor Author

Yes, I just found that in "raw" stable10 I am getting:

     │ object(Sabre\HTTP\Response)#2177 (5) {
      │   ["status":protected]=>
      │   int(404)
      │   ["statusText":protected]=>
      │   string(9) "Not Found"
      │   ["body":protected]=>
      │   string(222) "<?xml version="1.0" encoding="utf-8"?>
      │ <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
      │   <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
      │   <s:message>File not found: meta in 'root'</s:message>
      │ </d:error>

The test code accesses a meta endpoint which does not exist yet in stable10

@PVince81
Copy link
Contributor

PVince81 commented Jun 7, 2018

@phil-davis argh, indeed. That's the endpoint that the backport brings in for the version changes.

So we couldn't make this test work with the old API without changing the steps to talk to the old private API. Ok, let's leave this then.

@phil-davis
Copy link
Contributor Author

As a separate thing tomorrow morning, I will see if I can make a version restore test in the webUI that will go through the described steps in the issue. I think we have some webUI restore steps already, so it might be quite easy (famous last words) to construct a scenario that fails. That would provide something that a dev can use to confirm a fix.

@PVince81
Copy link
Contributor

PVince81 commented Jun 7, 2018

great plan, thanks

@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants