-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unit tests don't mock the network requests #233
Comments
This is fine. IMO we really care if we can go to mozilla.org and see if can scrape out the information we need. We don't really care if we got networking/GET requests right. Since mozilla.org is not tightly coupled to pollbot, if they change their html or anything that affects our scraping I think the tests should just fail. That'll be a good trigger for us to go fix / change something. |
The point is that the tests are going to stop working soon. In mysterious ways. Considering that PollBot poorly swallows errors it's going to be a pain to comprehend why CI stopped working one day. |
By the way, I think an end-to-end test is quite nice. Every URL that Delivery Dashboard hits should probably be hit too. E.g. for product in test_config.all_supported_products:
for api_url_template in test_config.all_api_url_templates:
url = api_url_template.format(product)
response = requests.get(url)
assert response.status_code == 200 Except, this wouldn't work anyway because of this ;) |
Just as a thing, mozilla.org redesigned their I'm not sure what "The point is that the tests are going to stop working soon" means. What's going to cause them to stop working? Changes to mozilla.org and other things that PollBot uses? Isn't that a good thing? I think I want to WONTFIX this. |
If you switch off your WiFi and run the whole test suite this happens:
That's because those 38 tests depend on actually going out on the network and going to URLs like https://www.mozilla.org/en-US/firefox/58.0beta/releasenotes/
That means the test suite (at least those ~38 tests) aren't unit tests really. They're end-to-end tests.
I'm not worried about the traffic burden on www.mozilla.org and product-details.mozilla.org etc. I'm worried that soon those URLs will expire and tests will fail and nobody will understand how or why.
The text was updated successfully, but these errors were encountered: