Closed alexanderward closed 3 years ago
Unable to run tests locally.
(venv) $ (selenium-head-docker) $ cat dev_env/docker/environment.json
{
"admins": [],
"branding": "",
"db": "postgres://postgres:PASSWORD@postgres_dev:5432/govready_q",
"debug": true,
"email": {},
"enable_toolbar": false,
"govready-url": "http://localhost:8000",
"govready_cms_api_auth": "",
"gr-img-generator": "wkhtmltopdf",
"gr-pdf-generator": "wkhtmltopdf",
"mailgun_api_key": "",
"memcached": false,
"okta": {},
"secret-key": "jq)0vhewuso$z=qqtb^=2)9louud$dnlch-thutcbrhky56k_c",
"selenium-grid-browser": "chrome",
"selenium-headless": false,
"session_security_expire_after": 1800,
"session_security_expire_at_browser_close": true,
"session_security_warn_after": 1200,
"single-organization": "",
"static": "static_root",
"syslog": "",
"test_visible": false,
"trust-user-authentication-headers": {}
}
And tests come back like this from running docker exec -it govready-q-dev ./manage.py test
======================================================================
ERROR: setUpClass (siteapp.tests.QuestionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/src/app/siteapp/tests.py", line 75, in setUpClass
super(SeleniumTest, cls).setUpClass()
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1548, in setUpClass
raise cls.server_thread.error
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1474, in run
self.httpd = self._create_server()
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1488, in _create_server
return ThreadedWSGIServer((self.host, self.port), QuietWSGIRequestHandler, allow_reuse_address=False)
File "/usr/local/lib/python3.8/dist-packages/django/core/servers/basehttp.py", line 71, in __init__
super().__init__(*args, **kwargs)
File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/lib/python3.8/wsgiref/simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "/usr/lib/python3.8/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
======================================================================
ERROR: setUpClass (siteapp.tests.SupportPageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/src/app/siteapp/tests.py", line 75, in setUpClass
super(SeleniumTest, cls).setUpClass()
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1548, in setUpClass
raise cls.server_thread.error
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1474, in run
self.httpd = self._create_server()
File "/usr/local/lib/python3.8/dist-packages/django/test/testcases.py", line 1488, in _create_server
return ThreadedWSGIServer((self.host, self.port), QuietWSGIRequestHandler, allow_reuse_address=False)
File "/usr/local/lib/python3.8/dist-packages/django/core/servers/basehttp.py", line 71, in __init__
super().__init__(*args, **kwargs)
File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/lib/python3.8/wsgiref/simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "/usr/lib/python3.8/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
----------------------------------------------------------------------
Ran 38 tests in 22.453s
FAILED (errors=21)
Pillow upgrade has been merged into this branch.
@alexanderward Does
"selenium-headless": true,
and"test_visible": false,
inenvironment.json
conflict?Here is my
environment.json
after runningpython run.py init
:BTW, I am running after updating
requirements.in
andrequirements.txt
for issue with Pillow reported by Snyk.