Merge "Include placeholder tasks in get_running_builds"

This commit is contained in:
Zuul 2020-03-04 02:58:33 +00:00 committed by Gerrit Code Review
commit 9e66e45f0a
2 changed files with 3 additions and 9 deletions

View File

@ -1461,7 +1461,7 @@ class Jenkins(object):
raise raise
for executor in info['executors']: for executor in info['executors']:
executable = executor['currentExecutable'] executable = executor['currentExecutable']
if executable and 'PlaceholderTask' not in executable.get('_class', ''): if executable and 'number' in executable:
executor_number = executor['number'] executor_number = executor['number']
build_number = executable['number'] build_number = executable['number']
url = executable['url'] url = executable['url']

View File

@ -432,7 +432,7 @@ class JenkinsListRunningBuildsTest(JenkinsTestBase):
@patch.object(jenkins.Jenkins, 'get_node_info') @patch.object(jenkins.Jenkins, 'get_node_info')
@patch.object(jenkins.Jenkins, 'get_nodes') @patch.object(jenkins.Jenkins, 'get_nodes')
def test_placeholder_task_in_queue(self, nodes_mock, node_info_mock): def test_unnumbered_task_in_queue(self, nodes_mock, node_info_mock):
nodes_to_return = [{ nodes_to_return = [{
'name': "foo-slave", 'offline': False 'name': "foo-slave", 'offline': False
}] }]
@ -448,13 +448,7 @@ class JenkinsListRunningBuildsTest(JenkinsTestBase):
"progress": -1 "progress": -1
}, },
{ {
'currentExecutable': { 'currentExecutable': {},
'_class': (
'org.jenkinsci.plugins.workflow.support.steps.'
'ExecutorStepExecution$PlaceholderTask$'
'PlaceholderExecutable'
)
},
'currentWorkUnit': {}, 'currentWorkUnit': {},
'idle': False, 'idle': False,
'likelyStuck': False, 'likelyStuck': False,