Closed pushrbx closed 1 year ago
This one is a bit problematic if we don't use cache. For example forum and user friend list changes constantly.
@nerg4l I was thinking the same thing. Not sure what an approach for this would be if we were to update the cache periodically.
In the past I used squid proxy, which cached pages for a week. (see my python-mal repo)
We could use the same in this case too, however we need to figure out the best ttl.
Then the tests will fail after a week. Not sure how we can make sure to have consistent data with up to date HTML structure. We could maybe run tests against less popular (almost dead) anime, manga, forum, etc.
How about some DIY low budget rotating proxy?
The configuration is a bit complicated, afaik you need to set routes in iptables.
To add to the discussion: An outdated cache for some tests might benefit.
For example, I just added approved
to the Anime/Manga model to help detect entries that have been deleted from MAL or are not approved. So we can remove them from the search on the REST API or delete them in a scheduled sweep.
Commit: https://github.com/jikan-me/jikan/commit/be4bc5759dc960ca1ec232092fba14ceb4fb46ba
This adds a fixture of entries which are unapproved: https://github.com/jikan-me/jikan-fixtures/commit/197b8b4c5444faa083c4b9a1ea0123eb52b887d9 As of testing: https://myanimelist.net/anime/48104 is pending approval
Since this would later be either
It would benefit having their fixtures remain unchanged to test against approval status.
This issue will be closed and archived in 18 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
We'd like to get updated if the tests break over time, so we will know if the DOM of MAL pages have changed.