Skip to content

[test-only][full-ci] ApiTest. creating a shared resource with an expiration date - #5424

Merged
v-scharf merged 1 commit into
masterfrom
shareResourceWithExpirateDate
Feb 1, 2023
Merged

v-scharf merged 1 commit into
masterfrom
shareResourceWithExpirateDate

Conversation

@v-scharf

@v-scharf v-scharf commented Jan 18, 2023 •

Copy link
Copy Markdown
Contributor
  • changed tests shareSubItemOfSpace.feature add ability to set expire date
  • refactoring code
  • deleted core test
  • created test share to group
  • test for change expiration date
  • created bug Sharing to a group with an expiration date does not work #5442
  • test where user shares to group and to user with different role and expiration date. I haven't idea what should I expect in the GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/shareId response

@update-docs

update-docs Bot commented Jan 18, 2023

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@ownclouders

ownclouders commented Jan 18, 2023 •

Copy link
Copy Markdown
Contributor

💥 Acceptance test Core-API-Tests-ocis-storage-4 failed. Further test are cancelled...

@v-scharf
v-scharf force-pushed the shareResourceWithExpirateDate branch from 8ac521b to 71abe89 Compare January 20, 2023 11:28
@v-scharf
v-scharf force-pushed the shareResourceWithExpirateDate branch from 69ca246 to af30a39 Compare January 20, 2023 16:30

@saw-jan saw-jan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indentation only

@v-scharf v-scharf changed the title [test-only] ApiTest. creating a shared resource with an expiration date [test-only][full-ci] ApiTest. creating a shared resource with an expiration date Jan 23, 2023
@v-scharf

v-scharf commented Jan 23, 2023 •

Copy link
Copy Markdown
Contributor Author

when creating the test, I noticed a difference in the expiration date between share and share public link
https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/bootstrap/Sharing.php#L1292-L1296

method isFieldInResponse cannot work for share фтв public link because expects date in format: 2023-01-31 22:59:59

actual expiration date in response
share: <expiration>2023-01-31T23:59:59+0100</expiration>
public link: <expiration>2023-01-31 22:59:59</expiration>

in some body request expireDate is different so I changed test where I set the required time in the request and wait for the required time in the response

@v-scharf
v-scharf force-pushed the shareResourceWithExpirateDate branch 4 times, most recently from e4c86f4 to 3b959b9 Compare January 23, 2023 21:49
And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]'
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this necessary?
Can we only assert the date (2040-01-01) but not the time in order to cope with the differences? That way we may use incremental days +3.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did this for more transparency. If we use this aproach In the test, we can see what date format we use in the body of the request and what date format we get in the response. Unfortunately, we have a difference in this (I created a bug), and I have to postpone PR until it's clearer how it's supposed to work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we get a different date format in the response, so I:

@v-scharf
v-scharf force-pushed the shareResourceWithExpirateDate branch 2 times, most recently from 71b2e3a to b6d5a4e Compare January 31, 2023 15:33
@v-scharf v-scharf added the Status:Needs-Review Needs review from a maintainer label Jan 31, 2023

@saw-jan saw-jan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@SagarGi SagarGi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm 👍

@sonarqubecloud

sonarqubecloud Bot commented Feb 1, 2023

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 A 0 Code Smells

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

@v-scharf
v-scharf dismissed individual-it’s stale review February 1, 2023 08:55

Arthur has vacation

@v-scharf
v-scharf merged commit 486453b into master Feb 1, 2023
@delete-merged-branch
delete-merged-branch Bot deleted the shareResourceWithExpirateDate branch February 1, 2023 08:55
ownclouders pushed a commit that referenced this pull request Feb 1, 2023
Author: Viktor Scharf <[email protected]>
Date:   Wed Feb 1 09:55:51 2023 +0100

    create share with expirate date. refactoring code (#5424)
@v-scharf v-scharf mentioned this pull request Feb 8, 2023
24 tasks done
@saw-jan saw-jan mentioned this pull request Feb 28, 2023
2 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:Needs-Review Needs review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants