-
Notifications
You must be signed in to change notification settings - Fork 186
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
Enable API testing #1699
Enable API testing #1699
Conversation
e56db97
to
2e9e309
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
cef43a1
to
f00968d
Compare
The API has many potential cases to test for, it will probably take some time to test all. But the base setup works nicely. It even works with my instance living in a vm, reachable via http. That is also how I developed the tests so far. VM running nextcloud and news bridged network test from local repo executing bats on host machine, replace baseurl var in the helper script. |
42389f4
to
21a3ac2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
https://nextcloud.github.io/news/api/api-v1/#mark-items-of-a-folder-as-read is broken, the reason is simple news/lib/Controller/FolderApiController.php Line 146 in f4aba4f
parameter maxItemId should be newestItemId
|
e389b40
to
23f8255
Compare
Any idea how we can track the coverage in a readable format? I don't think I can cover every single endpoint option in this PR, especially for items it's just too much and some of the cases are difficult to test, like for a human easy but in bash you have to make arrays and compare them to each other. |
@SMillerDev the /items/updated api is in fact broken because when items get marked as read the lastModified timestamp is not updated. Marking as read is not enough here as this is api is supposed to return all changed items since lastModified. Same would be for staring an item I think maybe more? |
I think that information got lost over time and this requires a new |
I'm not sure if I understand, every item has a last modified timestamp and a pub date. This API checks if there is any item with a last modified bigger than the input. Any action that modifies an item should (based on this API) update the last modified to the current timestamp. I think all we need to do is, to adjust the dB mappers for any changing method to also update the last modified. |
I think that would also mean that it reappears on top of the feed right? Since it's then updated again? |
hmm I think it shouldn't as the items would be marked as read too. It's the apps responsibility to deal with that. And it breaks syncing with the android app.
This timestamp is not supposed to be used for item sorting but rather a technical marker for the last change. Alternatively we could drop the current API and built a new one. |
Same for marking an item as starred or unread again. The api is supposed to give the latest changes. Since the last sync. |
rebased on master |
rebase on master |
rebased |
rename integration to command Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
add bats-assert and support as submodule test with all db types Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This PR enables API testing by using the integrated PHP webserver.
For the test management bats is used. To query the api httpie offers more options than curl but both can be used.