Skip to content

tests for rest.py fail in Travis because of API rate limiting #268

@boegel

Description

@boegel
ERROR: Test all request methods
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/hpcugent/vsc-base/test/rest.py", line 74, in test_request_methods
    status, body = self.client.head()
  File "lib/vsc/utils/rest.py", line 128, in head
    return self.request(self.HEAD, url, None, headers)
  File "lib/vsc/utils/rest.py", line 175, in request
    conn = self.get_connection(method, url, body, headers)
  File "lib/vsc/utils/rest.py", line 206, in get_connection
    connection = self.opener.open(request)
  File "/opt/python/2.6.9/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/opt/python/2.6.9/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/python/2.6.9/lib/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/opt/python/2.6.9/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/opt/python/2.6.9/lib/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

We can fix this by using a GitHub token in Travis, and skip the tests that require a token when the token is missing (token will never be available when testing PRs because of security reasons).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions