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>
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.
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.
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.
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 stage often gets blocked and takes hours until it gets cancelled.
Add a 10 minutes timeout to make it fail faster.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
Currently, we are using just `conf.arches` and `conf.base_module_arches`
to define the list of arches for which the RPMs in a submitted module are
built. This is not enough, because RCM needs to generate modules based
on the base modules which should use different arches.
This commit changes the MBS to take the list of arches from the buildrequired
module build. It checks the buildrequires for "privileged" module or base
module and if it finds such module, it queries the Koji to find out the list
of arches to set for the module.
The "privileged" module is a module which can override base module arches
or disttag. Previously, these modules have been defined by
`allowed_disttag_marking_module_names` config option. In this commit,
this has been renamed to `allowed_privileged_module_names`.
The list of arches are stored per module build in new table represented
by ModuleArch class and are m:n mapped to ModuleBuild.
In certain use-cases, a module's buildrequires may remain the same
in the modulemd, but a different support stream of the buildrequired
base module should be used. For example, since RHEL 8.0.0 is GA, any
modules that buildrequire platform:el8.0.0 should buildrequire
platform:el8.0.0z instead.
Set a consistent set of options on Jenkins pipeline jobs. This includes timestamps,
reasonable timeouts, saving only the last 10 builds (to avoid filling up the disk
of the Jenkins master), disabling concurrent builds (to avoid hitting quota limits),
and skipping the default checkout (all jobs that need the source call checkout()
explicitly).
Previously, the integration test pipeline was configured to always use the tests present on the
master branch. When running the pre-merge pipeline for a PR, this would result in potentially
out-dated tests being run. This change runs the tests from the current branch, allowing the code
and the tests to evolve together.
This also disables the default checkout of the master branch, which is unnecessary when calling
checkout() from the pipeline.
The old way performed a `DISTINCT (module_builds.id)` on the original query passed in
to ModuleBuild._add_virtual_streams_filter, but this caused issues when the original
query was ordered by something other than ID on Postgres databases. This new approach
uses a subquery to filter that module builds with the desired virtual streams, and then
joins this subquery to the original query.
The context column was added in d83e6897ca. The
migration set `nullable=False`, but the model kept the default of `nullable=True`.
This caused `mbs-manager db migrate` to create a migration for setting the context
collumn to `nullable=True`.
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.