2793 Commits

Author SHA1 Message Date
Brendan Reilly
9f5a053c4f Release 3.1.0 3.1.0 2020-04-27 13:39:25 -04: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
Mike McLean
058fd9579f Merge #1594 Add test_reuse_tagged_module 2020-04-09 13:50:07 +00:00
Brendan Reilly
e68f5c4c26 Use repo id instead of latest symlink
Fixes https://pagure.io/fm-orchestrator/issue/1581
2020-04-02 12:12:13 -04:00
Brendan Reilly
25cdfbbd22 Add the ability to limit arches 2020-04-01 17:02:51 +00:00
jobrauer
47c782b13e Remove type hint 2020-03-27 10:52:34 +01:00
jobrauer
b9dee9d454 Add test_reuse_tagged_module 2020-03-27 10:44:56 +01:00
Mike McLean
6bb4e06c21 Merge #1589 Add test_buildrequire_module_not_in_tag 2020-03-24 17:48:19 +00:00
mprahl
244f29f25f Make record_module_build_arches idempotent
This function could get called multiple times if the init handler
runs more than once. This can happen if the build failed in the
init handler due to external infrastructure being down and the
user resumes their build.
2020-03-23 20:22:57 +00:00
mprahl
fee1dff8d0 Honor the MBS_CONFIG_SECTION environment variable when performing a local build 2020-03-17 17:08:27 -04:00
mprahl
f6dd4cbaa7 Remove an outdated comment in Dockerfile-tests 2020-03-16 09:19:51 -04:00
mprahl
c073061025 Fix the source_dir path in run-unittests.sh 2020-03-16 09:19:40 -04:00
Matt Prahl
53ed214195 Merge #1604 Remove obsolete testing scripts 2020-03-16 12:46:56 +00:00
mprahl
7045b21716 Move run-unittests.sh to the project root 2020-03-12 09:30:15 -04:00
mprahl
4bf1bd862e Remove obsolete testing scripts 2020-03-12 09:28:16 -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
Merlin Mathesius
da51bebcd9 New 'module_stream' optional parameter
- Implement new optional parameter module_stream to allow a scratch module
  build's stream name to be set from the command line when also submitting a
  YAML modulemd file.
- Validate that module_name and module_stream parameters can only be specified
  along with a YAML modulemd file.
- Add tests to verify that module_stream sets the stream name correctly.
- Add tests to verify that module_name and module_stream are only allowed along
  with a YAML modulemd file.

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2020-03-10 14:08:29 +00:00
Merlin Mathesius
de2a776226 Skip git ref checks for rpm components with srpm overrides
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2020-03-10 14:02:11 +00:00
Merlin Mathesius
ab90c7b710 Clean up unused test code to avoid confusion
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2020-03-10 14:02:11 +00:00
mprahl
691d865a7e Install zipp in the CentOS test image to prevent a tox exception 2020-03-09 16:20:47 -04:00
mprahl
7547680731 Pull the Postgres image in parallel with the other images during CI 2020-03-09 13:13:32 -04:00
jobrauer
5d8a54db23 Add test.env example 2020-03-09 08:57:38 +01:00
mprahl
9bd1e201ca Update the change log v3.0.0 2020-03-06 14:07:37 -05:00
Mike McLean
6c9f61e465 Merge #1577 Check schedule date when adding new streams 2020-03-06 16:56:17 +00:00
Brendan Reilly
2f75b5e711 extend unittest 2020-03-05 16:28:42 -05:00
Brendan Reilly
88597a7c92 Check schedule date when adding new streams 2020-03-05 16:28:42 -05:00
mprahl
ecc3222387 Fix a flaky test 2020-03-04 16:58:03 -05:00
mprahl
57d02ac3ba Make the code that ignores messages consistent 2020-03-04 16:11:25 -05:00
mprahl
757191fded Bubble up IgnoreMessage exceptions in get_abstracted_event_info
This allows the MBSConsumer.consume method to log the message and return
without calling the validate_event method.
2020-03-04 16:11:25 -05:00
mprahl
d2b3eace3d Handle when a message parser returns None
mbs-messaging-umb is such a parser that returns None if a message
does not match the schema it is validating against.
2020-03-04 16:11:25 -05:00
mprahl
841a64a757 Bump the version to v3.0.0 2020-03-03 16:09:24 -05:00
Chenxiong Qi
1c0715662a Cleanup module_build_service/__init__.py
Most of the code are moved to dedicated subpackages, but some others
can't due to the cycle dependencies.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:48 -05:00
Chenxiong Qi
1e5ed864c9 Avoid to handle a late init message
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
81b36b1d6e Add indexes to ModuleBuild and ComponentBuild
Tests are updated accordingly as well.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
83b9e56f46 Remove workaround from handlers init and wait
Commit 98b1ac79 ensures the message is sent after data changes are
committed into database. Hence, it is doable to remove these two
workarounds.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
b70c632a70 Send module build state change message after commit to database
In MBS, there are two cases to send a message when a module build moves
to a new state. One is to create a new module build, with
ModuleBuild.create particularly, when user submit a module build.
Another one is to transition a module build to a new state with
ModuleBuild.transition. This commit handles these two cases in a little
different ways.

For the former, existing code is refactored by moving the publish call
outside ModuleBuild.create.

For the latter, message is sent in a hook of SQLAlchemy ORM event
after_commit rather than immediately inside the ModuleBuild.transition.

Both of these changes ensure the message is sent after the changes are
committed into database successfully. Then, the backend can have
confidence that the database has the module build data when receive a
message.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
b21e130555 Reuse make_module in mmd resolver tests
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
d068ff06c4 Use anonymous koji session to list build RPMs
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
Chenxiong Qi
e258ea3e7c Add a test for generating koji tag for a scratch build
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
2020-03-03 14:48:47 -05:00
mprahl
352ca36c88 Remove the sys.modules patches in the tests
This is no longer needed since
https://pagure.io/fm-orchestrator/pull-request/1563
2020-03-03 14:48:47 -05:00
mprahl
f1f92a4d25 Use an in-memory SQLite database to run the tests
This change was lost from the following PR during a rebase:
https://pagure.io/fm-orchestrator/pull-request/1511
2020-03-03 14:48:47 -05:00
mprahl
59980b1219 Use patch.dict instead of modifying the environment variable in test_standalone_metrics_server 2020-03-03 14:48:47 -05:00
mprahl
5ecde6dc5f Use a context manager to patch sys.modules
When not using the context manager, it causes the pytest process
to not close after the tests have completed when the tests are
run using Python 3.
2020-03-03 14:48:47 -05:00
mprahl
27972706f0 Remove the dependency on Flask-SQLAlchemy in DBResolver.py 2020-03-03 14:48:47 -05:00
mprahl
81f2bffdda Rearrange the imports to meet the style guide
This also includes `from __future__ import absolute_import`
in every file so that the imports are consistent in Python 2 and 3.
The Python 2 tests fail without this.
2020-03-03 14:48:47 -05:00
mprahl
0c8227679c Clean up build logs after each test so that it doesn't affect tests run later
Tests in test_build.py started to affect tests in test_content_generator.py
after test_content_generator.py was moved, which caused those tests to execute
after test_build.py
2020-03-03 14:48:47 -05:00
mprahl
f1520625c7 Move test_content_generator.py to test_builder/test_content_generator.py 2020-03-03 14:48:47 -05:00
mprahl
c10a6769ed Move scm.py to common/scm.py 2020-03-03 14:48:47 -05:00
mprahl
4b32612002 Move route.py to scheduler/route.py 2020-03-03 14:48:47 -05:00