Commit Graph

904 Commits

Author SHA1 Message Date
Joe Talbott
06d31786e8 Improve error messaging for module submission.
Fixes: https://pagure.io/fm-orchestrator/issue/1098
2021-07-29 16:34:03 -04:00
Joe Talbott
933c4fd8dd Update error message. 2021-07-29 16:21:55 -04:00
Joe Talbott
6b42102cc6 Fail if requested side tag is not available for any base modules. 2021-07-29 16:21:55 -04:00
Brendan Reilly
669318f1fd Exclude specific platform streams from stream expansion
Fixes: #1639
2021-07-29 15:15:03 -04:00
Jan Kaluza
bfd9a13205 Allow overriding RPM components refs while submitting the module build.
There is a need to rebuild the module builds done in CentOS 9 Stream
internally in MBS to include them in RHEL. This is currenly a hard task,
because the RPM components included in a module are usually
taken from HEAD of the branch defined by their `ref` value.

For the rebuild task, it means we would have to ensure that the HEAD
of all RPM components points to right commit hash right before we start
rebuilding CentOS 9 Stream module in internal MBS. This is very hard
and fragile thing to do, especially if there are two different modules
using the RPM component from the same branch. This is prone to race
condition and makes the rebuilds quite complex and in some cases
not possible to do without force pushes to RPM component repositories
which is not acceptable by internal dist-git policy.

This commit fixes it by allowing overriding the commit hash while
submitting the module build. This helps in the mentioned situation,
because we can keep internal RPM components branches in 1:1 sync with
CentOS 9 Stream branches and HEAD can always point to the same commit
in both internal and CentOS 9 Stream repositories.

When the module rebuild is submitted in internal MBS,
we can use this new feature to override the `ref` for each RPM component
so it points to particular commit and the requirement for HEAD to point
to this commit is no longer there.

The `ref` is overriden only internally in MBS (but it is recorded in logs
and in XMD section), so the input modulemd file is not altered. This is
the same logic as used for other overrides (`buildrequire_overrides` or
`side_tag`).

This does not bring any security problem, because it is already possible
to use commit hash in `ref`, so the package maintainer can already change
the commit hash to any particular commit by using this `ref` value.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2021-07-28 08:48:12 +02:00
Joe Talbott
b3203caf76 List missing streams in exception message.
Fixes: https://pagure.io/fm-orchestrator/issue/1574
2021-06-25 15:49:09 -04:00
Martin Curlej
71a44bdfb6 Fixed scratch build suffix bug
When building a scratch build of a module with static context
the scratch suffix was added twice.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-06-16 12:06:14 -04:00
Mike McLean
af97a23bca additional unit tests for strict_module_state_transitions 2021-06-15 15:05:06 -04:00
Mike McLean
fcd662468f fix unit tests 2021-06-15 15:05:06 -04:00
Mike McLean
d6185e806e new unit test 2021-05-06 13:43:30 -04:00
Mike McLean
53000c0783 fix unit test 2021-05-06 12:05:07 -04:00
Mike McLean
22ffe54b63 more flake8 fixes: integration tests 2021-04-21 16:31:48 -04:00
jobrauer
f8530a49da Integration tests: add v3-packager coverage 2021-03-12 14:25:53 +01:00
jobrauer
46f27ce3ed Integration tests: enable parameters for clone_and_start_build fixture. 2021-03-12 14:12:53 +01:00
Brendan Reilly
d0579a16c1 Fix mmd.copy calls to support PackagerV3
Fixes #1685
2021-03-10 15:00:42 -05:00
Mike McLean
8b15bcaf94 unit tests 2021-03-10 12:55:04 -05:00
Martin Curlej
7976b1f084 Added the support for the new libmodulemd v3 packager format.
This will enable building modules from the new libmodulemd v3 format.
This format fixes major issue with modularity which enables clear
upgrade paths for multicontext modules.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2021-03-03 13:01:50 +01:00
Mike McLean
0b653b73a0 check that our test data has deps
This unit test previously failed to detect a bug because the test data
had no deps.
2021-02-08 19:59:15 -05:00
Mike McLean
b9ca83f8b3 update unit test data 2021-02-08 19:59:15 -05:00
Mike McLean
dfd44e0b09 add dependencies to nginx test mmd 2021-02-08 16:24:09 -05:00
jobrauer
d3656b159b test_reuse_components_if_added: keep order in rpms, set -> list 2020-12-04 13:08:55 +01:00
jobrauer
bd4372315f Make koji and MBS client fixtures function scoped 2020-12-04 13:08:55 +01:00
jobrauer
d264ea3337 Test utils - bump up the build wait-timeout to 10 hours 2020-12-04 13:08:55 +01:00
jobrauer
f9b6002797 Test utils - add retry mechanism for MBS queries 2020-12-04 13:08:55 +01:00
jobrauer
de46aa9373 Test utils - in case of scratch build, don't wait for 'ready' state 2020-12-04 13:08:55 +01:00
jobrauer
adf56083fc test_reuse_components_if_added: assert test branch modulemd 2020-12-04 13:08:55 +01:00
jobrauer
3a9480de93 Extend MBS waiting times to prevent timeouts on stage. 2020-12-04 13:08:55 +01:00
Brendan Reilly
ed86a2ca72 Do not add conflicts when builds are identical
Fixes: #1660
2020-11-11 16:03:52 -05:00
jobrauer
6385d465d7 Add test_submit_module_build 2020-09-21 12:51:36 +02:00
jobrauer
e9df47d80c Add test_static_context 2020-09-10 13:27:21 +00:00
Brendan Reilly
107fe1cc9e Merge #1650 Add test_memory 2020-09-10 13:24:05 +00:00
Martin Curlej
c139e4cb60 Added the ability to build modules with static contexts
This is a fix and feature in one. This patch enables to use static
contexts instead of module stream expansion. This fixes the issue with
upgrade path issue in dnf.

Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2020-09-03 09:22:08 +02:00
jobrauer
6400b64741 Add test_memory
- Add a script that runs test MBS instance.
- Add memory tracking test-case.
- New tox environment: run with 'tox -e memory'.
2020-08-18 14:48:49 +02:00
jobrauer
87c83ad0b8 Add test 'reuse components if added' 2020-08-07 15:47:39 +02:00
Brendan Reilly
5c13368f77 Only get latest build of latest stream when determining requirements 2020-07-24 11:43:07 -04:00
jobrauer
face187260 RHELBLD-265: Refactor reuse_component_init_data
Replace db_session.commit() calls with flush in reuse_component_init_data as well as init_data functions.
2020-07-23 14:06:59 +00:00
jobrauer
8adf1dbedf JIRA: RHELBLD-264 - do cleanup/init once per class
Make test_mock.py and test_content_generator.py use class scoped fixture.
2020-07-14 11:35:19 +00:00
jobrauer
736d202d35 RHELBLD-264: refactor init_data()
Add variant of get_rpm_release(), with no db access.
Reduce number of db_session.commit() calls to just one at the end.
2020-07-14 11:26:58 +00:00
jobrauer
2c9984c803 Add test_scratch_final_mmd 2020-07-13 13:29:34 +00:00
jobrauer
d6c42882aa JIRA: RHELBLD-266 - Split TestViews
- split logically TestViews into separate test classes
- create class scope variants of common fixtures
- use class scope fixtures where applicable (TestViews)
- remove redundant fixture 'model_tests_init_data'
2020-06-30 08:28:45 +00:00
jobrauer
4b52b853c5 Mock Greenwave query_policies() 2020-06-29 07:41:46 +00:00
Brendan Reilly
db70560d2d Add API call to get final modulemds of builds 2020-06-22 11:31:05 -04:00
Brendan Reilly
98cc909ab8 Merge #1626 Refactor clean_database 2020-06-09 12:34:41 +00:00
jobrauer
c584d84b76 JIRA: RHELBLD-257,RHELBLD-310 - refactor clean_database
Replace clean_database calls with cheaper truncate operation.
Remove duplicate calls of clean_database.
Extract clean_database/init_data into fixtures.
2020-05-15 16:06:42 +02:00
Martin Filip
6ae9e1aeff Add test_highest_version_selection.py, example.test.env.yaml and expand utils.py 2020-05-13 08:52:46 -04:00
jobrauer
5bdae7a356 Add test.env example 2020-05-11 15:50:53 +02:00
jobrauer
110a17a57f Add 'test_rest_module_build' 2020-05-06 14:14:37 +02:00
jobrauer
53351670e3 Add test_buildonly 2020-05-05 15:37:11 +02:00
jobrauer
98ed3abc72 Add test_import_module 2020-04-24 13:43:33 +02:00
Mike McLean
f34e68d314 temporarily disable test_submit_build_buildonly
This is a workaround for https://pagure.io/fm-orchestrator/issue/1598
We should re-enable this test in the future.
See: https://pagure.io/fm-orchestrator/issue/1617
2020-04-16 11:19:25 -04:00