-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix(test): test cases with example.com
URL
#238
fix(test): test cases with example.com
URL
#238
Conversation
Signed-off-by: Junjie Gao <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #238 +/- ##
==========================================
- Coverage 91.89% 91.29% -0.61%
==========================================
Files 30 30
Lines 2074 2608 +534
==========================================
+ Hits 1906 2381 +475
- Misses 114 173 +59
Partials 54 54 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Signed-off-by: Junjie Gao <[email protected]>
Replaced |
example.com
URL
Oh, I was thinking we are mocking the server using https://pkg.go.dev/net/http/httptest#Server. Then we could use the Yeah, as Shiwei suggested below, |
@JeyJeyGao RFC 2606 defines some safer domains (see https://datatracker.ietf.org/doc/html/rfc2606#section-2) |
Signed-off-by: Junjie Gao <[email protected]>
Updated the URL to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What about |
Signed-off-by: Junjie Gao <[email protected]>
Nice catch! Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix:
*.com
with*.test
to avoid mentioning a real domain in testing URLNOTE:
.test
is a reserved domain for testing in RFC 2606