mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-11-29 23:54:58 +08:00
Handle module builds without components
This commit is contained in:
34
tests/staged_data/python3-no-components.yaml
Normal file
34
tests/staged_data/python3-no-components.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
# This module is left empty because python3 is contained in the
|
||||
# Platform module of Fedora 27 Modular Server edition.
|
||||
|
||||
# Other modules can depend on this empty one so that, when the
|
||||
# implementation of python3 is moved out of the Platform module,
|
||||
# other modules should not be affected.
|
||||
|
||||
document: modulemd
|
||||
version: 1
|
||||
data:
|
||||
summary: Python programming language, version 3
|
||||
description: >-
|
||||
Python is an interpreted, interactive, object-oriented programming
|
||||
language often compared to Tcl, Perl, Scheme or Java. Python includes
|
||||
modules, classes, exceptions, very high level dynamic data types
|
||||
and dynamic typing. Python supports interfaces to many system calls and
|
||||
libraries, as well as to various windowing systems (X11, Motif, Tk,
|
||||
Mac and MFC).
|
||||
|
||||
Programmers can write new built-in modules for Python in C or C++.
|
||||
Python can be used as an extension language for applications that
|
||||
need a programmable interface.
|
||||
license:
|
||||
module:
|
||||
- MIT
|
||||
dependencies:
|
||||
buildrequires:
|
||||
bootstrap: master
|
||||
requires:
|
||||
platform: master
|
||||
references:
|
||||
community: https://www.python.org/
|
||||
documentation: https://docs.python.org/3/
|
||||
tracker: https://src.fedoraproject.org/modules/python3
|
||||
@@ -316,6 +316,33 @@ class TestBuild(unittest.TestCase):
|
||||
self.assertEqual(tag_groups, [])
|
||||
self.assertEqual(buildroot_groups, [])
|
||||
|
||||
@timed(30)
|
||||
@patch('module_build_service.auth.get_user', return_value=user)
|
||||
@patch('module_build_service.scm.SCM')
|
||||
def test_submit_build_no_components(self, mocked_scm, mocked_get_user, conf_system, dbg):
|
||||
"""
|
||||
Tests the build of a module with no components
|
||||
"""
|
||||
FakeSCM(mocked_scm, 'python3', 'python3-no-components.yaml',
|
||||
'620ec77321b2ea7b0d67d82992dda3e1d67055b4')
|
||||
|
||||
rv = self.client.post('/module-build-service/1/module-builds/', data=json.dumps(
|
||||
{'branch': 'master', 'scmurl': 'git://pkgs.stg.fedoraproject.org/modules/'
|
||||
'testmodule.git?#68932c90de214d9d13feefbd35246a81b6cb8d49'}))
|
||||
|
||||
data = json.loads(rv.data)
|
||||
module_build_id = data['id']
|
||||
|
||||
msgs = []
|
||||
stop = module_build_service.scheduler.make_simple_stop_condition(db.session)
|
||||
module_build_service.scheduler.main(msgs, stop)
|
||||
|
||||
module_build = models.ModuleBuild.query.filter_by(id=module_build_id).one()
|
||||
# Make sure no component builds were registered
|
||||
self.assertEqual(len(module_build.component_builds), 0)
|
||||
# Make sure the build is done
|
||||
self.assertEqual(module_build.state, models.BUILD_STATES['ready'])
|
||||
|
||||
@timed(30)
|
||||
@patch('module_build_service.auth.get_user', return_value=user)
|
||||
@patch('module_build_service.scm.SCM')
|
||||
|
||||
Reference in New Issue
Block a user