Open projekt01 opened 10 years ago
Our tests should not depend on google.
If we want on-the-wire tests, we can spawn a subprocess running a hello world app with wsgiref.
"Fixed" in ad659fae4287a25d1127b68182ea64b1807becc2.
@tseaver Still an issue?
@florianpilz The error seems to have cleared on 2016-05-15, but I cannot see any commit here which would explain that. Furthermore, the zope.testbrowser_py_270_32
builder is now gone from winbot, which makes sleuthing for it hard (maybe that is when the builder was dropped?)
The real underlying issue (making an across-the-wire request to a third-party service in a unit test) is still an issue.
Looks like Google has changed the policy again (or am I wrong?):
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/over_the_wire.txt", line 21, in over_the_wire.txt
Failed example:
browser.open('http://google.com/ncr')
Expected:
Traceback (most recent call last):
...
RobotExclusionError: HTTP Error 403: request disallowed by robots.txt
Got:
Traceback (most recent call last):
File "/usr/lib64/python2.7/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest over_the_wire.txt[3]>", line 1, in <module>
browser.open('http://google.com/ncr')
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py", line 251, in open
self._processRequest(url, make_request)
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py", line 275, in _processRequest
resp = make_request(reqargs)
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py", line 249, in make_request
return self.testapp.get(url, **args)
File "/usr/lib/python2.7/site-packages/webtest/app.py", line 335, in get
expect_errors=expect_errors)
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py", line 91, in do_request
self._assertAllowed(req.url)
File "/home/abuild/rpmbuild/BUILD/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py", line 85, in _assertAllowed
rp.read()
File "/usr/lib64/python2.7/robotparser.py", line 58, in read
f = opener.open(self.url)
File "/usr/lib64/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib64/python2.7/urllib.py", line 350, in open_http
h.endheaders(data)
File "/usr/lib64/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 821, in connect
self.timeout, self.source_address)
File "/usr/lib64/python2.7/socket.py", line 557, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -3] Temporary failure in name resolution
No, the error you see here indicates that the tests were unable to resolve google.com.
(I still think it's a mistake for zope.testbrowser's tests to do real HTTP requests to 3rd-party websites, but I've no energy to fix this.)
The over_the_wire.txt test fails on the initial request too not only on the later request with a query string. Probably google changed the rules.
Probably we should skip/remove the on the wire tests at all because it's not what the testbrowser is used to do.