Tests should use VCR or a fixture server and avoid connecting to third-party services
Closed this issue · 5 comments
Some tests connect to third-party services, which we should avoid because they could cause intermittent and confusing failures in CI (like this one for @vbanos: #233 (comment)). This also prevents tests from being run locally without a network connection, which is also no fun.
Our web_monitoring.db
tests use VCR for this:
web-monitoring-processing/web_monitoring/tests/test_db.py
Lines 14 to 59 in 70292c8
And our utils
tests use mock requests for simpler cases:
web-monitoring-processing/web_monitoring/tests/test_utils.py
Lines 48 to 53 in edc47ba
First, we need to see what tests this includes. So far:
- Lots of these in
test_diffing_server_exc_handling.py
We need to be better about making sure future PRs that add new tests do this, too.
More case in point: https://circleci.com/gh/edgi-govdata-archiving/web-monitoring-processing/585
And again, this prevented @jsnshrmn from doing a release today: https://circleci.com/gh/edgi-govdata-archiving/web-monitoring-processing/772
Update: need to re-check this issue for whether it still applies to anything in this repo after #638.
This is indeed no longer relevant.