Skip to content

Conversation

@skshetry
Copy link
Member

Backport for #33647

This commit, although a bit hacky, adds the test for the `files:scan`
in the Occ. The config didn't seem to have come into effect when set.
But, i noticed that the config was coming into effect when it was
force-scanned. Needs further investigation if `files_external:option`
is the problem or not.
@phil-davis
Copy link
Contributor

@skshetry scenario fails https://drone.owncloud.com/owncloud/core/12999/436

  Scenario: Adding a folder to local storage, sharing with groups and running scan for specific group should add files for users of that group # /drone/src/tests/acceptance/features/cliMain/files.feature:46
    Given using new DAV path                                                                                                                   # FeatureContext::usingOldOrNewDavPath()
    And these users have been created with default attributes:                                                                                 # FeatureContext::theseUsersHaveBeenCreated()
      | username |
      | user0    |
      | user1    |
    And group "newgroup" has been created                                                                                                      # FeatureContext::groupHasBeenCreated()
    And user "user0" has been added to group "newgroup"                                                                                        # FeatureContext::userHasBeenAddedToGroup()
    And user "user1" has been added to group "newgroup"                                                                                        # FeatureContext::userHasBeenAddedToGroup()
    And user "user0" has created a folder "/local_storage/folder1"                                                                             # FeatureContext::userCreatesAFolder()
    And the administrator has set the external storage to be never scanned automatically                                                       # OccContext::theAdministratorHasSetTheExternalStorageToBeNeverScannedUsingTheOccCommand()
    And user "user0" has shared folder "/local_storage/folder1" with group "newgroup"                                                          # FeatureContext::userHasSharedFileWithGroupUsingTheSharingApi()
    And the administrator has scanned the filesystem for all users                                                                             # OccContext::theAdministratorScansTheFilesystemForAllUsersUsingTheOccCommand()
    And the administrator has scanned the filesystem for group "newgroup"                                                                      # OccContext::theAdministratorScansTheFilesystemForGroupUsingTheOccCommand()
    When the administrator creates file "folder1/hello1.txt" with content "<? php :)" in local storage using the testing API                   # FeatureContext::theAdministratorCreatesFileUsingTheTestingApi()
    And user "user0" requests "/remote.php/dav/files/user0/local_storage/folder1" with "PROPFIND" using basic auth                             # FeatureContext::userRequestsURLWithUsingBasicAuth()
    Then the propfind result of "user0" should not contain these entries:                                                                      # FeatureContext::propfindResultShouldContainEntries()
      | /local_storage/folder1/hello1.txt |
    When user "user1" requests "/remote.php/dav/files/user1/local_storage/folder1" with "PROPFIND" using basic auth                            # FeatureContext::userRequestsURLWithUsingBasicAuth()
    Then the propfind result of "user0" should not contain these entries:                                                                      # FeatureContext::propfindResultShouldContainEntries()
      | /local_storage/folder1/hello1.txt |
    When the administrator scans the filesystem for group "newgroup" using the occ command                                                     # OccContext::theAdministratorScansTheFilesystemForGroupUsingTheOccCommand()
    And user "user0" requests "/remote.php/dav/files/user0/local_storage/folder1" with "PROPFIND" using basic auth                             # FeatureContext::userRequestsURLWithUsingBasicAuth()
    Then the propfind result of "user0" should contain these entries:                                                                          # FeatureContext::propfindResultShouldContainEntries()
      | /local_storage/folder1/hello1.txt |
      response does not contain the entry '/local_storage/folder1/hello1.txt'
      Failed asserting that a boolean is not empty.
    When user "user1" requests "/remote.php/dav/files/user1/folder1" with "PROPFIND" using basic auth                                          # FeatureContext::userRequestsURLWithUsingBasicAuth()
    Then the propfind result of "user1" should contain these entries:                                                                          # FeatureContext::propfindResultShouldContainEntries()
      | /folder1/hello1.txt |

I wonder if there is a real bug on stable10 when doing files:scan for a group?

Please have a look.

@skshetry
Copy link
Member Author

It is passing locally. Maybe, it's a timing issue?

@phil-davis
Copy link
Contributor

I restarted the drone build. Let's see.

@skshetry
Copy link
Member Author

skshetry commented Nov 29, 2018

Also failed locally on the drone for stable10. Testing if it fails also on the master.

EDIT: Doesnot fail on master in drone locally, only fails on stable10 in drone.
Though, running test in stable10 works though.

@skshetry skshetry force-pushed the stable10-files-scan branch from 428d1f8 to cc82e91 Compare November 29, 2018 07:08
@codecov
Copy link

codecov bot commented Nov 29, 2018

Codecov Report

Merging #33685 into stable10 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             stable10   #33685   +/-   ##
===========================================
  Coverage       63.01%   63.01%           
  Complexity      18918    18918           
===========================================
  Files            1242     1242           
  Lines           74190    74190           
  Branches         1287     1287           
===========================================
  Hits            46750    46750           
  Misses          27060    27060           
  Partials          380      380
Flag Coverage Δ Complexity Δ
#javascript 53.12% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.08% <ø> (ø) 18918 <ø> (ø) ⬇️

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 621a3c6...cc82e91. Read the comment docs.

@skshetry
Copy link
Member Author

Fixed. Turns out that the option name was changed on the master from groups to group.

@phil-davis
Copy link
Contributor

I remember that. The change was not back-ported because it would break command-line backward-compatibility. So the command change will be released in OC11.

@skshetry skshetry merged commit 60c9ece into stable10 Nov 29, 2018
@phil-davis phil-davis deleted the stable10-files-scan branch November 29, 2018 08:14
@PVince81 PVince81 modified the milestones: development, QA Jan 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
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.

4 participants