Closed JeyJeyGao closed 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.29%. Comparing base (
3067ab1
) to head (1c112ba
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I would suggest replacing any real URLs in test files with fake ones even though we are mocking the servers. This is to avoid future mistaken tests that a developer forgot to mock the server and a real roundtrip got sent out.
How can we ensure the URL is fake? Maybe the fake one will be registered by someone else later.
I would suggest replacing any real URLs in test files with fake ones even though we are mocking the servers. This is to avoid future mistaken tests that a developer forgot to mock the server and a real roundtrip got sent out.
Replaced example.com
with example.fake
How can we ensure the URL is fake? Maybe the fake one will be registered by someone else later.
Oh, I was thinking we are mocking the server using https://pkg.go.dev/net/http/httptest#Server. Then we could use the server.URL
directly, turns out we are mocking the http client transport.
Yeah, as Shiwei suggested below, .test
is probably a better option for us.
@JeyJeyGao RFC 2606 defines some safer domains (see https://datatracker.ietf.org/doc/html/rfc2606#section-2)
@JeyJeyGao RFC 2606 defines some safer domains (see https://datatracker.ietf.org/doc/html/rfc2606#section-2)
Updated the URL to be localhost.test
What about uncached.com
?
What about
uncached.com
?
Nice catch! Updated.
Fix:
*.com
with*.test
to avoid mentioning a real domain in testing URLNOTE:
.test
is a reserved domain for testing in RFC 2606