'rpm' is an optional dependency for kobo, which is required by the
integration tests.
Previously this dependency was implicitly satisfied by 'koji' pulling
in 'rpm-py-installer' which made sure 'rpm' is available. But
koji==1.20.0 made this dependency optional, so importing kobo.rpmlib
started failing.
Fix this by making 'rpm-py-installer' and explicit dependency for the
integration test environment.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
The integration tests under 'tests/integration' are Python 3 only.
Flake8 will fail on Python 3 syntax when running under Python 2, but for
now we wouldn't like to change this, in order to keep Python 2
compatibility of the code base.
To work around the above, set up a separate tox environment to lint the
integration tests, and exclude linting the integration tests when the
rest of the code is checked.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
This is the first step to have some tests, that we could run against an
MBS instance, to check that it's functionally correct. Ultimately, these
will replace the test scripts (`contrib/test-*`).
This doesn't really do anything yet, but I would like to make sure that
everyone is on the same page regarding how this will be set up.
Signed-off-by: Hunor Csomortáni <csomh@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>
Sometimes, it would be convenient to run flake8 directly rather than
`tox -e flake8` and the flake8 section in tox.ini will apply to both of
them.
In addition, exclude ./.env as well.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
- Refactor MBS API code
- Unify module-/component_build API philosophy/design/approach
- Naming fixes
- _utc_datetime_to_iso moved from ModuleBuildAPI and is now a module-level function.
- Existing v1 API remains unchanged. ComponentBuildAPI now supports individual component build listing + verbose mode.
- documented in README
- various component_build API tests added