Skip to content

api-test: check that report contains favorites#2531

Open
ScharfViktor wants to merge 3 commits intomainfrom
check-report-contains-favorites
Open

api-test: check that report contains favorites#2531
ScharfViktor wants to merge 3 commits intomainfrom
check-report-contains-favorites

Conversation

@ScharfViktor
Copy link
Copy Markdown
Contributor

related #2510

step: And as user "Alice" folder/file "name" should be favorited checks that Propfind has <oc:favorite>1</oc:favorite>

this PR adds checking that Report response contains<oc:favorite>1</oc:favorite> if file/folder marked as favorite or <oc:favorite>0</oc:favorite> if it's not favorite

@ScharfViktor
Copy link
Copy Markdown
Contributor Author

@aduffeck here are some failed tests because REPORT doesn't return <oc:favorite>0</oc:favorite>

I expect similar behavior with PROPFIND response

Steps:

  • create folders main/sub and main/sub-1
  • mark main/sub favorites
  • request PROPFING: both contain oc:favorite
Screenshot 2026-03-26 at 16 34 52
  • request REPORT (search by sub): only main/sub contains oc:favorite

but main/sub-1 doesn't contains oc:favorite - ❌️
Screenshot 2026-03-26 at 16 39 06

@aduffeck
Copy link
Copy Markdown
Member

Hm, o we really have to include the <oc:favorite>0</oc:favorite> in the response for each item that isn't a favorite (which is gonna be almost every result)?
If clients don't require it I would rather omit the negative case. @AlexAndBear @JammingBen do you have an opinion on that?

@AlexAndBear
Copy link
Copy Markdown
Member

@aduffeck web doesn't require it 🤷‍♀️

@ScharfViktor
Copy link
Copy Markdown
Contributor Author

ScharfViktor commented Mar 26, 2026

If clients don't require it I would rather omit the negative case.

I think we specify what we want to get through the PROPFIND request payload:

<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> <d:prop> <oc:permissions/> <oc:favorite/> <oc:fileid/> <oc:file-parent/> <oc:name/> <d:lockdiscovery/> <d:activelock/> <oc:owner-id/> <oc:owner-display-name/> <oc:remote-item-id/> <oc:shareroot/> <oc:share-types/> <oc:privatelink/> <d:getcontentlength/> <oc:size/> <d:getlastmodified/> <d:getetag/> <d:getcontenttype/> <d:resourcetype/> <oc:tags/> <oc:audio/> <oc:location/> <oc:image/> <oc:photo/> <oc:has-preview/> </d:prop> </d:propfind> 

if we exclude <oc:favorite/> -> response will be without favorite

But it doesn't work for REPORT:

  • if we exclude <oc:favorite/> -> we still get <oc:favorite>1</oc:favorite>
  • if we send request with <oc:favorite/> -> we don't get <oc:favorite>0</oc:favorite>
@aduffeck
Copy link
Copy Markdown
Member

I don't think we have to support all features for REPORT which we support for PROPFIND. I'd rather not add complexity to the code which isn't really needed by the server or the clients and remove those tests again to be honest.
We can always implement that behavior when it's actually needed.

@ScharfViktor
Copy link
Copy Markdown
Contributor Author

I don't think we have to support all features for REPORT which we support for PROPFIND. I'd rather not add complexity to the code which isn't really needed by the server or the clients and remove those tests again to be honest. We can always implement that behavior when it's actually needed.

Yeah, agree. I deleted tests which expected <oc:favorite>0</oc:favorite> in the report response

@ScharfViktor ScharfViktor requested a review from aduffeck March 27, 2026 08:11
@ScharfViktor
Copy link
Copy Markdown
Contributor Author

image

https://ci.opencloud.rocks/repos/3/pipeline/2447/config

we forgot that some depended pipelines can be skipped

Example here:
my Pr changes only tests/acceptance/ -> test-litmus doesn't start because exclude": skipIfUnchanged(ctx, "litmus")

all-checks-finished doesn't start because no test-litmus in the depends_on

Copy link
Copy Markdown
Member

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants