In order to restore staging/prod deploy process CI/CD tests need to be fixed.
Problem or idea
Found 25 test(s).
Creating test database for alias 'default'...
/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py:336: RuntimeWarning: Normally Django will use a connection to the 'postgres' database to avoid running initialization queries against the production database when it's not needed (for example, when running tests). Django was unable to create a connection to the 'postgres' database and will use the first PostgreSQL database instead.
warnings.warn(
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 331, in _nodb_cursor
with super()._nodb_cursor() as cursor:
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 711, in _nodb_cursor
with conn.cursor() as cursor:
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 265, in connect
self.init_connection_state()
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 251, in init_connection_state
super().init_connection_state()
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 232, in init_connection_state
self.check_database_version_supported()
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 207, in check_database_version_supported
raise NotSupportedError(
django.db.utils.NotSupportedError: PostgreSQL 11 or later is required (found 9.606).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.8/dist-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "database" (172.17.0.2), port 5432 failed: FATAL: database "test_data_refinery" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/test.py", line 24, in run_from_argv
super().run_from_argv(argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/test.py", line 68, in handle
failures = test_runner.run_tests(test_labels)
File "/usr/local/lib/python3.8/dist-packages/django/test/runner.py", line 1051, in run_tests
old_config = self.setup_databases(
File "/usr/local/lib/python3.8/dist-packages/django/test/runner.py", line [947](https://github.com/AlexsLemonade/refinebio/actions/runs/4019855935/jobs/6907173643#step:9:948), in setup_databases
return _setup_databases(
File "/usr/local/lib/python3.8/dist-packages/django/test/utils.py", line 220, in setup_databases
connection.creation.create_test_db(
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/creation.py", line 62, in create_test_db
self._create_test_db(verbosity, autoclobber, keepdb)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/creation.py", line 198, in _create_test_db
with self._nodb_cursor() as cursor:
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 357, in _nodb_cursor
with conn.cursor() as cursor:
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.8/dist-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "database" (172.17.0.2), port 5432 failed: FATAL: database "test_data_refinery" does not exist
Solution or next step
Resolve version requirements problem (upgrade postgres?).
Context
In order to restore staging/prod deploy process CI/CD tests need to be fixed.
Problem or idea
Solution or next step
Resolve version requirements problem (upgrade postgres?).