Repository navigation
Commit ccfc7ab
test(uptime): Mock the robots.txt fetch in candidate URL tests (#127947)
Four `ProcessCandidateUrlTest` tests (`test_succeeds_*`) call
`process_candidate_url` for random `https://sentry-<hex>.io` domains.
That fetches `robots.txt` over the real network. The outbound network
guard in report mode (#127944) caught these on a full backend run.
These domains don't resolve, so `check_url_robots_txt` catches the error
and allows the URL. The class now has an autouse `responses` fixture
that answers those `robots.txt` URLs with a 404. `get_robots_txt_parser`
turns that into an empty, allow-all parser, so the tests get the same
outcome without a DNS lookup or a connection. Tests that already patch
`get_robots_txt_parser` don't change. No assertions change.
This PR only changes tests and doesn't depend on #127944. I ran the file
locally with `SENTRY_NETWORK_GUARD=strict`: it passes, and the guard
records no outbound attempts.
<!-- junior-request-attribution:start -->
via @joshuarli.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A35c0cbe32045897a494787cce713d692 -->
--
[View Junior
Session](https://junior-prod.sentry.dev/conversations/agent%3A35c0cbe32045897a494787cce713d692)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A35c0cbe32045897a494787cce713d692/?project=4510944073809921)
<!-- junior-session-footer:end -->
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Joshua Li <14209781+joshuarli@users.noreply.github.com>1 parent 41f9e5a commit ccfc7ab
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
230 | 244 | | |
231 | 245 | | |
232 | 246 | | |
| |||
0 commit comments