This also includes `from __future__ import absolute_import`
in every file so that the imports are consistent in Python 2 and 3.
The Python 2 tests fail without this.
This moves the code used by the backend and API to common/submit.py,
the code used just by the API to web/submit.py, and the code used
just by the backend to scheduler/submit.py.
Since the tests now run in a different location in the container
since PR #1378, the documentation needed to be updated. Instead,
we should just allow the user to pass a relative path instead.
For example, contrib/run-unittests.sh /src/tests/test_utils ...
Please note that the path starts from /src, which is the root directory of
code inside container.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This patch introduces a new environment variable in order to allow running
tests with different database backend. This is useful particularly for running
tests inside container. With this change, it is possible run tests in following
combinations:
* Python 2 and SQLite
* Python 3 and SQLite
* Python 2 and PostgreSQL
* Python 3 and PostgreSQL
Package python-psycopg2 is installed in both Dockerfile-tests and
Dockerfile-tests-py3 in case of running tests with PostgreSQL.
A new script contrib/run-unittests.sh is added to make it easy to run tests. An
example:
contrib/run-unittests.sh --py3 --with-pgsql
that runs tests with Python 3 and PostgreSQL.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Recommend using podman instead of docker because:
* one can spin up containers without sudo with podman;
* docker in Fedora has a really old version, and probably will be
depercated at some point.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
This development environment has not been maintained in a long time
and it doesn't work anymore. Let's remove it for now and reintroduce
containers when we start using OpenShift for development.