Commit Graph

2366 Commits

Author SHA1 Message Date
Jan Kaluza
e9f5b4e2db Fix unreliable test in test_module_init.py. 2019-07-09 11:26:02 +02:00
mprahl
96d44d049e Add the ability to automatically buildrequire default modules defined by the buildrequired base module
A base module can set xmd.mbs.default_modules_url, which contains a
URL to a list of modules in the format of name:stream separated by
new lines. When a module buildrequires this base module, the list
of default modules are added as buildrequires of the module automatically
unless there are conflicting streams or the default module is not
in the MBS database.
2019-07-05 14:52:50 -04:00
mprahl
9f55ce724d Add a global requests session with retry logic configured
This also replaces the usage of other request sessions.
2019-07-03 09:00:49 -04:00
mprahl
db03f0a7f5 Promote resolver._get_module to a public method 2019-07-02 10:45:31 -04:00
Matt Prahl
1585d6b97c Merge #1319 Reuse method read_staged_data and ModuleBuild.get_by_id 2019-07-02 14:15:44 +00:00
Chenxiong Qi
60b0e8da5c Wait for Postgres to be running before starting the unit tests
Fixes #1314

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-07-02 20:54:26 +08:00
Chenxiong Qi
16bf4e945b Reuse ModuleBuild.get_by_id
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-07-02 20:52:12 +08:00
Chenxiong Qi
c15a7cadf3 Reuse function read_staged_data
In addition, reuse staged_data_filename to construct file and directory name.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-07-02 20:52:12 +08:00
Valerij Maljulin
a80f15a6d3 Release v2.24.0 v2.24.0 2019-07-02 13:43:47 +02:00
Valerij Maljulin
7277ac480f Release v2.22.0 2019-07-01 17:26:31 +02:00
mprahl
50f0a60ec1 Allow configuring the number of parallel submissions to Koji
When NUM_CONCURRENT_BUILDS is 0, then multi-threading is disabled
when submitting builds to Koji. This is not acceptable, so this
commit makes the number of threads configurable.
2019-07-01 08:12:12 -04:00
Chenxiong Qi
fadbc26994 Enable PostgreSQL for running tests
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-28 21:35:00 +08:00
Matt Prahl
f3fecf5089 Merge #1309 Fix tests in order to run with PostgreSQL 2019-06-28 13:21:08 +00:00
Matt Prahl
1282a775a0 Merge #1310 Fix type error preventing inclusion of custom SRPMs when running on F31/Rawhide. 2019-06-28 12:49:10 +00:00
Chenxiong Qi
e49f69f7b5 Fix tests in order to run with PostgreSQL
Most of the issues are caused by the use of SQLAlchemy database session. Some
inline comments describe the issues in detail.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-28 14:48:37 +08:00
Merlin Mathesius
9f269c39e1 Older versions of kobo.rpmlib.get_header_field() return bytes, newer versions
return str. Decode as necessary.

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2019-06-27 10:44:58 -05:00
Mike Bonnet
302c76b90f add more information to the Pagure commit flags and PR status
This makes them more consistent with CentOS CI flags.

Also add the commit hash to the uid, so updates are commit-specific.
2019-06-25 21:41:38 -04:00
Valerij Maljulin
f0dc0b851d Add state_reason on GW failure
Signed-off-by: Valerij Maljulin <vmaljuli@redhat.com>
2019-06-25 17:39:40 +02:00
Matt Prahl
cde8d8058d Merge #1304 Add additional documentation about rebuild strategies 2019-06-25 14:29:52 +00:00
mprahl
c887448a7c Add additional documentation about rebuild strategies 2019-06-25 10:19:23 -04:00
Jan Kaluža
1a8ac64850 Merge #1305 Minor fixes to _get_filtered_rpms_on_self_dep 2019-06-25 11:49:55 +00:00
Martin Curlej
ed24ca870a Module builds now remember what module they reused for building.
There was a race condition, when 2 builds where build in the same time.
There was an issue that after one has finished the other reused the new build
for reuse and not the one it started with.

Ticket-ID: FACTORY-3862

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2019-06-25 11:09:33 +02:00
Chenxiong Qi
5bdb77777f Minor fixes to _get_filtered_rpms_on_self_dep
* Add docstring
* Call dict.setdefault to simplify the code a little which constructs the map
  from package name to built RPMs' NVRs.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-25 15:13:22 +08:00
mprahl
35eb016fd8 Move the Rebuild Strategies documentation to a separate file 2019-06-24 14:29:58 -04:00
mprahl
e19c58b6ad Stop testing with Postgresql temporarily
The Jenkins job currently stalls with this enabled, so let's disable
it for now.
2019-06-21 10:50:51 -04: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
Matt Prahl
567a05b09c Merge #1291 Run unit tests with PostgreSQL in Jenkins job 2019-06-20 16:32:22 +00:00
Matt Prahl
7341e68ff7 Merge #1292 Remove unused variable local_modules from GenericBuilder.default_buildroot_groups 2019-06-20 16:31:24 +00:00
Jan Kaluza
e1b29d2fde Version 2.23.0 v2.23.0 2019-06-20 06:55:00 +02:00
Chenxiong Qi
8728afffd7 Remove unused variable local_modules from GenericBuilder.default_buildroot_groups
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-20 10:25:05 +08:00
Jan Kaluza
c9d2b77167 When no architecture is set in Koji tag, fallback to conf.arches 2019-06-19 14:32:10 +02:00
Chenxiong Qi
05f78504ef Run unit tests with PostgreSQL in Jenkins job
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-19 11:06:21 +08:00
mprahl
6a850e4996 Pass --no-tty to run-unittests.sh when being run by Jenkins 2019-06-18 10:56:24 -04:00
Matt Prahl
d9f2a6e68d Merge #1290 Add option --no-tty to run-unittests.sh 2019-06-18 14:52:57 +00:00
Chenxiong Qi
ee2036cd10 Add option --no-tty to run-unittests.sh
This is useful for running run-unittests.sh in Jenkins. When set --no-tty, -i
and -t are not added to docker-run command.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2019-06-18 22:48:15 +08:00
mprahl
e8b47e70d4 Fix the path to run-unittests.sh in .cico-pr.pipeline 2019-06-18 10:19:00 -04:00
mprahl
1a17d655ee Accept floats when filtering by stream_version_lte on the API 2019-06-18 10:19:00 -04:00
Valerij Maljulin
392a456dab Release v2.22.0 v2.22.0 2019-06-18 10:44:58 +02: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
Jan Kaluža
5794c4375d Merge #1281 Allow buildrequiring modules built against all platform streams. 2019-06-17 05:27:32 +00:00
Jan Kaluza
2778c39765 Allow buildrequiring modules built against all platform streams.
This commit fixes issue with following situation:

Module `foo` has been built with `buildrequires: platform: [f28]`
and `requires: platform: []`. It can therefore be used as a buildrequirement
on any platform stream. But if you want to build module `app` which
buildrequires `foo` on `platform:f30`, the MBS won't pull-in the `foo`
module build, because MBS currently limits the modules by the platform
they have been built for.

This commit adds new config option to allow including modules built
against any platform stream.
2019-06-17 07:25:50 +02:00
mprahl
9828a0127b Don't try to add duplicate buildrequires entries when importing a module
To do this, we need to use the same database session in import_mmd as in
ModuleBuild.get_buildrequired_base_modules, otherwise, the returned
ModuleBuild objects are in a detached state.
2019-06-13 07:49:30 -04:00
Matt Prahl
489fb89a52 Merge #1285 Invalid scmurl on import should yield status 400 2019-06-12 15:27:36 +00:00
Matt Prahl
eeecadd843 Merge #1279 Use image from Quay.io to run the tests 2019-06-12 14:49:42 +00:00
sarah256
0d3655c2a8 Invalid scmurl on import should yield status 400 2019-06-12 10:21:13 -04:00
Jan Kaluza
511cad8c14 Check if buildopts.get_rpm_whitelist() is really set before using it.
This fixes module builds which sets the `buildopts` for something else
than the RPM whitelist.

Before this commit, when `buildopts` was set, the RPM whitelist was
always taken from the buildopts even if it was not defined there.
This resulted in empty `rpm_whitelist` and therefore no pkglist set
in Koji tag.

In this commit, MBS uses whitelist from `buildopts` only if it is
really set by the module maintainer.
2019-06-12 14:17:26 +02:00
Hunor Csomortáni
1848350e13 Document updating the test images in Quay.io
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
e6640bb95b Use images from Quay to run the tests on CentOS CI
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
9b90836595 Document using images from Quay.io for testing
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-06-12 08:31:39 +02:00
Hunor Csomortáni
7db21b7385 Contributing: replace docker with podman
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>
2019-06-11 14:04:30 +02:00