-
Notifications
You must be signed in to change notification settings - Fork 192
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
Mocking the GitHub communications for functional tests #712
Comments
I spent a lot of time today looking at mocking modules and servers, and too many of them make the assumption that we want to mock out python unit tests. So instead I came up with the following idea: We have a Right now this is a READ-only solution, so it won't work for all tests or endpoints. But it's a start. |
Also need to figure out how to mock logins, and how to decide when to send some kind of fixture-auth.js and fixture-non-auth.js, etc. |
Also figure out why this breaks nose:
|
One ugly idea is to extend the decorator to take 2 args, and then decide which file to serve based on
|
That's likely breaking because we're just serving the same file to authed and non-authed. The suggestion in my previous comment would fix it. |
OK, just updated this so it's like |
Hmm, not super happy with this. It sort of falls apart with routes like |
OK, so the way around that is to do something like webcompat.com/webcompat/api/endpoints.py Lines 141 to 144 in 6dcfa73
|
Another way to approach this is instead of passing in a string that refers to a file is to pass in the API route/request URL. That way we can handle fixtures for multiple issues, for example -- the func tests look for 69, 200, 100, 101, etc. We could use a little magick™ to detect auth state, and if not authed look for a Everybody loves magical APIs. ✨ |
Or maybe I'm overthinking this. endpoints.py needs to worry about auth vs. non-auth. Let's just send a single fixture resource. |
A stopgap, but if the issues load faster than Intern can query the DOM, then we always fail. With this move, we have to hit the network and there is enough time. FIXME?
When we are testing the UI with intern, we want to make sure that the UI reacts accordingly to what we want of the user experience. Right now, the tests are dependent of Github communication but it's not necessary most of the time for the suer experience. Communications issues in between webcompat and github have to be dealt with elsewhere.
There is two features which are currently directly talking to Github.
decided in Paris september 2015 at webcompat meeting with @miketaylr
The text was updated successfully, but these errors were encountered: