Skip to content

[tests-only] Version metadata acceptance tests 20211125#39531

Closed
phil-davis wants to merge 4 commits intomasterfrom
version-metadata-acceptance-tests-20211125
Closed

[tests-only] Version metadata acceptance tests 20211125#39531
phil-davis wants to merge 4 commits intomasterfrom
version-metadata-acceptance-tests-20211125

Conversation

@phil-davis
Copy link
Copy Markdown
Contributor

@phil-davis phil-davis commented Nov 25, 2021

Description

This is on top of the code in PR #39516 "Version Metadata Continued"

I have adjusted "Scenario: enable file versioning and check the history of changes from multiple users" so that it expects the behavior that I think we want to have.

Related Issue

Part of https://github.com/owncloud/enterprise/issues/4518
and #39504

How Has This Been Tested?

CI

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

pushnov-i and others added 4 commits November 25, 2021 12:19
Co-authored-by: Ilia Pushnov <illia.pushnov@gmail.com>
- Write metadata about the author of the current version
- Delete the metadata file of the current version in case the master file is deleted
@phil-davis
Copy link
Copy Markdown
Contributor Author

phil-davis commented Nov 25, 2021

The scenario gets this result:

  Background:                                                                            # /home/phil/git/owncloud/core/tests/acceptance/features/apiVersions/fileVersions.feature:5
    Given using OCS API version "2"                                                      # FeatureContext::usingOcsApiVersion()
    And using new DAV path                                                               # FeatureContext::usingOldOrNewDavPath()
    And user "Alice" has been created with default attributes and without skeleton files # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()

  Scenario: enable file versioning and check the history of changes from multiple users                   # /home/phil/git/owncloud/core/tests/acceptance/features/apiVersions/fileVersions.feature:474
    Given the administrator has enabled the file version storage feature                                  # FeatureContext::theAdministratorHasEnabledTheFileVersionStorage()
    And user "Brian" has been created with default attributes and without skeleton files                  # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
    And user "Carol" has been created with default attributes and without skeleton files                  # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
    And user "David" has been created with default attributes and without skeleton files                  # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
    And user "Alice" creates folder "/test" using the WebDAV API                                          # FeatureContext::userCreatesFolder()
    And user "Alice" shares folder "/test" with user "Brian" with permissions "all" using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi()
    And user "Alice" shares folder "/test" with user "Carol" with permissions "all" using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi()
    And user "Alice" shares folder "/test" with user "David" with permissions "all" using the sharing API # FeatureContext::userSharesFileWithUserUsingTheSharingApi()
    And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"     # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt"     # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt"     # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "David" has uploaded file with content "uploaded content david" to "/test/textfile0.txt"     # FeatureContext::userHasUploadedAFileWithContentTo()
    When user "Alice" gets the number of versions of file "/test/textfile0.txt"                           # FilesVersionsContext::userGetsFileVersions()
    Then the number of versions should be "3"                                                             # FeatureContext::theNumberOfVersionsShouldBe()
    When user "Alice" downloads the version of file "/test/textfile0.txt" with the index "1"              # FilesVersionsContext::downloadVersion()
    Then the HTTP status code should be "200"                                                             # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the following headers should be set                                                               # FeatureContext::theFollowingHeadersShouldBeSet()
      | header              | value                                                                |
      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
    And the downloaded content should be "uploaded content carol"                                         # FeatureContext::downloadedContentShouldBe()
    When user "Alice" downloads the version of file "test/textfile0.txt" with the index "2"               # FilesVersionsContext::downloadVersion()
    Then the HTTP status code should be "200"                                                             # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the following headers should be set                                                               # FeatureContext::theFollowingHeadersShouldBeSet()
      | header              | value                                                                |
      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
    And the downloaded content should be "uploaded content brian"                                         # FeatureContext::downloadedContentShouldBe()
    When user "Alice" downloads the version of file "test/textfile0.txt" with the index "3"               # FilesVersionsContext::downloadVersion()
    Then the HTTP status code should be "200"                                                             # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the following headers should be set                                                               # FeatureContext::theFollowingHeadersShouldBeSet()
      | header              | value                                                                |
      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
    And the downloaded content should be "uploaded content alice"                                         # FeatureContext::downloadedContentShouldBe()
    When user "Alice" gets the version metadata of file "/test/textfile0.txt"                             # FilesVersionsContext::userGetsVersionMetadataOfFile()
    Then the author of the created version with index "1" should be "Carol"                               # FeatureContext::theAuthorOfEditedVersionFile()
    And the author of the created version with index "2" should be "Brian"                                # FeatureContext::theAuthorOfEditedVersionFile()
    And the author of the created version with index "3" should be "Alice"                                # FeatureContext::theAuthorOfEditedVersionFile()
      could not find version with index "3"

--- Failed scenarios:

    /home/phil/git/owncloud/core/tests/acceptance/features/apiVersions/fileVersions.feature:474

1 scenario (1 failed)
33 steps (32 passed, 1 failed)

The versions authors are now correct for those who "edited" the file (uploaded changed text) after Alice did the first upload. But I don't see any author information for the original file that was uploaded by Alice. (which is the 3rd version in the version history)

The CI result is in https://drone.owncloud.com/owncloud/core/33821/85/13

@phil-davis
Copy link
Copy Markdown
Contributor Author

I have confirmed this manually in the webUI. I upload a file, share it with other users, then do multiple edits by different users. The "author" of each edit is shown in the version history. But the author of the oldest version (the file that was first uploaded) is not shown:
No-author-of-oldest-version

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

57.8% 57.8% Coverage
0.0% 0.0% Duplication

@ownclouders
Copy link
Copy Markdown
Contributor

💥 Acceptance tests pipeline apiVersions-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/33821/85/1

@phil-davis phil-davis mentioned this pull request Nov 25, 2021
11 tasks
@phil-davis
Copy link
Copy Markdown
Contributor Author

phil-davis commented Dec 1, 2021

See #39544

@phil-davis phil-davis closed this Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants