Bug #4821

[SDKs] CLI tests should be better isolated from user configuration

Added by Brett Smith over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
SDKs
Target version:
Start date:
12/15/2014
Due date:
% Done:

0%

Estimated time:
Story points:
0.5

Description

Two of the CLI tests are not isolated from the user's Arvados configuration, and can fail depending on what API server it's pointed at. If you're pointed at a production cluster, this happens:

  1) Failure:
TestArvGet#test_file_to_file_no_overwrite_file [/home/brett/repos/arvados/sdk/cli/test/test_arv-get.rb:67]:
Expected /Error:/ to match "arv-get: Local file tmp/foo already exists.\n".

  2) Failure:
TestArvGet#test_file_to_file_no_overwrite_file_in_dir [/home/brett/repos/arvados/sdk/cli/test/test_arv-get.rb:79]:
Expected /Error:/ to match "arv-get: Local file tmp/foo already exists.\n".

If you're pointed at an API server that is down, you get this:

  1) Failure:
TestArvGet#test_file_to_file_no_overwrite_file_in_dir [/home/brett/repos/arvados/sdk/cli/test/test_arv-get.rb:79]:
Expected /Error:/ to match "Traceback (most recent call last):\n  File \"./bin/arv-get\", line 128, in <module>\n    api_client = arvados.api('v1')\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/arvados/api.py\", line 156, in api\n    svc = apiclient_discovery.build('arvados', version, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/oauth2client/util.py\", line 132, in positional_wrapper\n    return wrapped(*args, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/googleapiclient/discovery.py\", line 198, in build\n    resp, content = http.request(requested_url)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/arvados/api.py\", line 33, in http_request\n    return self.orig_http_request(uri, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1593, in request\n    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1335, in _request\n    (response, content) = self._conn_request(conn, request_uri, method, body, headers)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1291, in _conn_request\n    response = conn.getresponse()\n  File \"/usr/lib/python2.7/httplib.py\", line 1022, in getresponse\n    raise ResponseNotReady()\nhttplib.ResponseNotReady\n".

  2) Failure:
TestArvGet#test_file_to_file_no_overwrite_file [/home/brett/repos/arvados/sdk/cli/test/test_arv-get.rb:67]:
Expected /Error:/ to match "Traceback (most recent call last):\n  File \"./bin/arv-get\", line 128, in <module>\n    api_client = arvados.api('v1')\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/arvados/api.py\", line 156, in api\n    svc = apiclient_discovery.build('arvados', version, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/oauth2client/util.py\", line 132, in positional_wrapper\n    return wrapped(*args, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/googleapiclient/discovery.py\", line 198, in build\n    resp, content = http.request(requested_url)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/arvados/api.py\", line 33, in http_request\n    return self.orig_http_request(uri, **kwargs)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1593, in request\n    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1335, in _request\n    (response, content) = self._conn_request(conn, request_uri, method, body, headers)\n  File \"/tmp/tmp.vPBqSYCQYx/local/lib/python2.7/site-packages/httplib2/__init__.py\", line 1291, in _conn_request\n    response = conn.getresponse()\n  File \"/usr/lib/python2.7/httplib.py\", line 1022, in getresponse\n    raise ResponseNotReady()\nhttplib.ResponseNotReady\n".

Make sure these tests work consistently, regardless of the user's configuration. Based on the test names, I think these are intended to test a case more like the first one pasted here, and should look for that error message more specifically. That error message was last changed in August, which predates when we started running the CLI tests, so I don't believe the issue is that the code changed without the test changing.

History

#1 Updated by Brett Smith over 4 years ago

  • Description updated (diff)

#2 Updated by Brett Smith over 4 years ago

  • Description updated (diff)

#3 Updated by Tom Clegg over 4 years ago

Since run-tests.sh clears ARVADOS_* env vars, I'm guessing the test suite is loading config from $HOME/.config/..., and that feature means the test suite (and/or run-tests.sh) has to clear HOME as well as ARVADOS_* before running these tests...

#4 Updated by Tom Clegg over 4 years ago

  • Target version changed from Bug Triage to Arvados Future Sprints

#5 Updated by Tom Clegg over 4 years ago

  • Target version changed from Arvados Future Sprints to 2015-02-18 sprint

#6 Updated by Tom Clegg over 4 years ago

  • Target version changed from 2015-02-18 sprint to Arvados Future Sprints

#7 Updated by Tom Clegg over 4 years ago

  • Subject changed from [SDKs] CLI tests are not isolated from user configuration to [SDKs] CLI tests should be better isolated from user configuration

Also available in: Atom PDF