Commit Graph

42 Commits

Author SHA1 Message Date
Brendan Reilly
3c0c7d3029 Also run bandit during py3 unit tests 2022-03-22 13:55:27 -04:00
Brendan Reilly
addfd6d933 Fix py2 dockerfile 2021-03-23 15:56:37 -04:00
Brendan Reilly
74bb78068f Pull Fedora container from Fedora registry
We need to pull the image from here to avoid rate limiting from
dockerhub
2021-03-23 15:56:37 -04:00
Martin Curlej
013388cc62 Changed the docker fedora tag to latest.
It was set to fedora:31 which does not receives any updates now.
This will enable testing of new versions of libraries as libmodulemd
for example.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-01-06 14:56:50 +01:00
mprahl
f6dd4cbaa7 Remove an outdated comment in Dockerfile-tests 2020-03-16 09:19:51 -04:00
mprahl
9bcfa7a3cc Remove libmodulemd1 as a dependency in the Python 2 test image 2020-03-11 11:52:25 -04:00
mprahl
dc36ac1277 Stop upgrading the Flask packages in the CentOS Python 2 tests container image
This will ensure that the code works with the version of Flask in
RHEL 7.
2020-03-11 11:52:25 -04:00
mprahl
691d865a7e Install zipp in the CentOS test image to prevent a tox exception 2020-03-09 16:20:47 -04:00
Chenxiong Qi
b5bcc981f9 Add celery app instance with base config
This patch allows to schedule tasks and launch workers with basic
config. To launch a worker:

    celery -A module_build_service.celery_app -l info

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
87f4f3e546 Use distro.linux_distribution instead
platform.linux_distribution is removed since Python 3.8.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-11-18 10:41:41 +08:00
Hunor Csomortáni
8c0521cde3 Lint the integration tests with Python 3
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>
2019-11-07 14:30:49 +01:00
Mike Bonnet
86c85825ee update container base images to Fedora 31
Also update the uid management in the frontend image to be more consistent with
best practices, as demonstrated by:

https://github.com/RHsyseng/container-rhel-examples/tree/master/starter-arbitrary-uid

This allows the dependency on nss_wrapper to be dropped.
2019-11-01 12:04:36 -07:00
mprahl
2153f4d699 Alphabetize the dependencies in Dockerfile-tests 2019-09-13 08:35:17 -04:00
mprahl
bfd954f455 Provide context as to why the epel7Server-infra repo is required for the tests 2019-09-13 08:32:24 -04:00
mprahl
f8e4daae9f Unpin the libmodulemd RPMs 2019-09-13 08:32:24 -04:00
Chenxiong Qi
5d0969f312 Merge #1406 Show test coverage 2019-09-12 01:50:20 +00:00
mprahl
00e78494d9 Refactor handling of default buildroot modules (Ursa Prime)
This removes support for default_modules_url in the Platform XMD and
gets the list of default name:stream combinations to include in the buildroot
from https://pagure.io/releng/fedora-module-defaults.

Addresses #1402
2019-09-11 12:20:35 -04:00
Chenxiong Qi
dd1f918920 Show test coverage
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-09-10 23:02:36 +08:00
Chenxiong Qi
e3b14beacc Allow to run tests in containers in parallel
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-08-07 21:45:07 +08:00
Chenxiong Qi
51c3b39a52 Install pytest<5.0 for building py2 test image
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-08-06 10:21:03 +08:00
Chenxiong Qi
df66d4f1b2 Allow to run specific test in py3 test container
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-08-02 23:40:18 +08:00
Chenxiong Qi
5f93a47051 Allow to run specific test inside container
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>
2019-06-21 10:48:10 -04:00
Chenxiong Qi
630f7b4e18 Allow to run tests with PostgreSQL inside container
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>
2019-06-17 22:47:23 +08:00
mprahl
c1e2a5b0af Unpin the libmodulemd RPMs 2019-05-16 11:51:38 +00:00
mprahl
14098cea08 Migrate to libmodulemd v2
This also moves the methods load_mmd and load_mmd_file to
module_build_service.utils.general.

This also removes some MSE unit tests with a mix of positive and
negative streams since this is not supported in libmodulemd v2. The
user will be presented with a syntax error if they try to submit
such a modulemd file.
2019-05-13 13:40:37 -04:00
Mike Bonnet
9c3d9bb441 MBS-Koji integration tests
This change introduces a set of Jenkins pipelines for building MBS
images and running integration tests against Koji using those images.
These pipelines are directly based on the WaiverDB pipeline work:

https://pagure.io/waiverdb/blob/master/f/openshift

The results of those tests are used to provide feedback to Pagure PRs
and to promote images through a series of environments, which may be
used to implement a continuous deployment process.

The current test cases, written in Groovy, are:
 - module-build-init: initate a module build and check that tags
   and targets in Koji are created correctly
 - module-build-cgimport: build an empty module and ensure that
   results are imported correctly into Koji, using the CGImport
   interface
2019-04-30 15:27:28 -07:00
mprahl
b017dae68b Unpin the version of python-ldap3 in Dockerfile-tests since a new version has been released 2019-04-15 09:03:37 -04:00
mprahl
321bb4940f Unpin the libsolv version for the Python 3 tests since it's in stable 2019-04-04 13:45:14 +00:00
mprahl
24d2be565b Pin the version of libsolv in FEDORA-2019-c381c7bf54 for the tests 2019-04-03 15:24:43 -04:00
mprahl
bc2a1e8d3c Fix the unit tests 2019-04-03 14:40:52 -04:00
mprahl
56b234c2bb Update python-ldap3 to 2.6.1 for the unit tests
We had issues in the current released version in EPEL7, this is an
update in testing that we should use once it reaches stable.
2019-03-29 13:11:10 -04:00
Jan Kaluza
7052ea0a11 Make init handler idempotent.
This fixes the issue when module build is cancelled in init state.
2019-02-14 14:18:54 +01:00
Filip Valder
38c0ea6147 Basic monitoring w/-o MBS-specific metrics 2019-02-12 16:08:41 +00:00
mprahl
afd95f3043 Don't use more-itertools 6.0.0 in Python 2 tests 2019-02-12 15:04:16 +00:00
Mike Bonnet
0b3d7809f9 test pull requests under Python 3 as well 2019-02-08 17:43:43 +00:00
mprahl
fed906f9b4 Pin the python-ldap3 version in the unit tests while RHBZ#1664859 gets resolved 2019-01-16 15:49:24 -05:00
Jan Kaluza
0d66adbc17 Add list of built RPMs to architecture specific modulemd files in CG builds. 2018-09-12 07:45:46 +02:00
mprahl
44dfd0c37f Return the exit code from tox in docker/test.sh 2018-08-29 09:01:25 -04:00
mprahl
080eecf836 Fix the Docker image for running unit tests 2018-08-03 20:59:06 -04:00
mprahl
8adbd2a3d5 Stop installing missing deps from PyPi in the Docker image for the unit tests 2018-07-17 11:41:09 -04:00
Martin Curlej
dfe7660519 Removed PDC dependency from MBS and replaced it with MBS prod instance.
Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Removed pdc from comments.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Adding missing files.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Updated PR according to review.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Local modules builds now

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Removed copr from config

Signed-off-by: Martin Curlej <mcurlej@redhat.com>

Fixed bugs

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2018-07-04 10:13:18 +02:00
mprahl
83d7d96141 Use a volume when running the unit tests instead of copying the source in the image 2018-06-14 08:54:27 -04:00