Replace external Wikipedia dependency in tests with local servers#160
Conversation
|
I tried to remove the dependency on external URLs because wikipedia is rate limiting us. With the help of Claude I created two fake web servers:
It's a lot of code, I know, and these are more like "integration" test than unit tests. What do you think? :) |
|
There are 3 pending tests that are still in the queue. I think they are stuck, but I don't know why |
|
I think this could be a good approach. Odd that those tests are stuck though, but I could also maybe drop official support for 2.2 and below (over 12 years old now). I'll see if I can re-run the tests anyway. |
|
I've dropped the old versions, they relied on ubuntu 20 which is not available in github actions any more. It should hopefully work ok if you rebase. |
The HTTPS and large-image tests relied on a live Wikipedia URL which caused flaky failures due to HTTP 429 rate limiting. Replace with local test servers: a raw TCP slow-drip server that verifies FastImage reads only header bytes, and a WEBrick HTTPS server with a self-signed cert that exercises the real SSL codepath. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
98350df to
59ad39b
Compare
|
Rebased and now all tests are passing :), even ruby 4.0 |
Summary
use_ssl,verify_mode, etc.) without depending on external serviceswebrickas a dev dependency (needed for the HTTPS server)LargeImage,LargeImageInfo,LargeImageFetchLimit,HTTPSImage,HTTPSImageInfo) in favor of referencingGoodFixturesdirectlyTest plan
test_should_raise_when_asked_to_when_file_does_not_existandtest_should_work_with_domains_with_underscores)🤖 Generated with Claude Code