mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-12 17:44:59 +08:00
Reset batch counter and state_reason when resubmiting module
This commit is contained in:
@@ -627,7 +627,9 @@ def submit_module_build(username, url, mmd, scm, yaml, optional_params=None):
|
||||
raise Conflict(err_msg)
|
||||
log.debug('Resuming existing module build %r' % module)
|
||||
module.username = username
|
||||
module.transition(conf, models.BUILD_STATES["init"])
|
||||
module.transition(conf, models.BUILD_STATES["init"],
|
||||
"Resubmitted by %s" % username)
|
||||
module.batch = 0
|
||||
log.info("Resumed existing module build in previous state %s"
|
||||
% module.state)
|
||||
else:
|
||||
|
||||
@@ -331,6 +331,7 @@ class TestUtils(unittest.TestCase):
|
||||
module_build = models.ModuleBuild.query.filter_by(id=2).one()
|
||||
module_build.batch = 2
|
||||
module_build.state = models.BUILD_STATES['failed']
|
||||
module_build.state_reason = "Cancelled"
|
||||
module_build.version = 1
|
||||
|
||||
# Mark the components as COMPLETE/FAILED/CANCELED
|
||||
@@ -348,6 +349,8 @@ class TestUtils(unittest.TestCase):
|
||||
'master')
|
||||
|
||||
self.assertEqual(module_build.state, models.BUILD_STATES['wait'])
|
||||
self.assertEqual(module_build.batch, 0)
|
||||
self.assertEqual(module_build.state_reason, "Resubmitted by Tom Brady")
|
||||
self.assertEqual(complete_component.state, koji.BUILD_STATES['COMPLETE'])
|
||||
self.assertEqual(failed_component.state, None)
|
||||
self.assertEqual(canceled_component.state, None)
|
||||
|
||||
Reference in New Issue
Block a user