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

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

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

ScharfViktor
Copy link
Contributor

@ScharfViktor ScharfViktor commented Jan 18, 2023

  • 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
Copy link

update-docs bot commented Jan 18, 2023

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
Copy link
Contributor

ownclouders commented Jan 18, 2023

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

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

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

Indentation only

@ScharfViktor ScharfViktor 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
@ScharfViktor
Copy link
Contributor Author

ScharfViktor commented Jan 23, 2023

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

@ScharfViktor ScharfViktor force-pushed the shareResourceWithExpirateDate branch 4 times, most recently from e4c86f4 to 3b959b9 Compare January 23, 2023 21:49
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
Copy link
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
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
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:

@ScharfViktor ScharfViktor added the Status:Needs-Review Needs review from a maintainer label Jan 31, 2023
Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@SagarGi SagarGi left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@sonarcloud
Copy link

sonarcloud bot commented Feb 1, 2023

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

@ScharfViktor ScharfViktor 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)
@ScharfViktor ScharfViktor mentioned this pull request Feb 8, 2023
24 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