Closed Bug 1370249 Opened 7 years ago Closed 7 years ago

Block external HTTP requests whilst running the Python test suite

Categories

(Tree Management :: Treeherder, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

We've had a few cases where we've accidentally made Python unit tests depend on external resources (eg logs on S3), which means the tests fail when offline, plus result in non-deterministic behaviour when S3 is being flaky or the logs are expired.

Let's just block all external requests during the pytest run to prevent this from happening.

In order for this to have caught bug 1370229, we'll also need to stop the exceptions being swallowed (bug 1370246).
Depends on: 1370229
Attachment #8876222 - Flags: review?(cdawson)
Comment on attachment 8876222 [details] [review]
[treeherder] mozilla:block-unmocked-requests > mozilla:master

There was one small change request, but I didn't bother to make a "request for change" so I don't slow you down.  Thanks for catching and fixing this.  :)
Attachment #8876222 - Flags: review?(cdawson) → review+
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/c6432016947fbd2dea128abd5710986450854b68
Bug 1370249 - Block unmocked HTTP requests during Python tests

This prevents tests from inadvertently depending on external resources
(for example logs on S3) due to missing mocked responses.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: