> I think a testcase is needed with a different MP in a downstream job in
> TestIsJobOrDownstreamBuildingScenarios:
> ('downstream_job_building_with_different_mp',
> {'expected': False,
> 'job_params': {'merge_proposal': 'http://mp'},
> 'jenkins_data': {
> 'builds': [{
> 'building': True,
> 'actions': [{
> 'causes': [{
> 'upstreamProject': 'job',
> 'upstreamBuild': 22
> }]
> }],
> 'result': None}],
> 'upstreamProjects': [{
> 'name': 'job',
> 'builds': [
> {
> 'number': 22,
> 'actions': [{'parameters': [{
> 'name': 'merge_proposal',
> 'value': 'http://mp3'}]}]}
> ]}]}}),
>
> The scenario is that job was started with "http://mp3" and it is still active
> in a downstream build (like generic-land). A new MP, "http://mp" is being
> checked, no matching builds should be found. I'm guessing at the correct
> scenario, it may not be quite right.
Added.
> Some comments appear to be out of place:
> - In is_job_or_downstream_building(), the docstring refers to "the json
> request below" which is actually in is_downstream_job_running().
> - is_job_or_downstream_building() and _is_item_queued_by_upstream() are
> missing parameters and return value in the docstring.
> - In _get_build_actions(), there is a comment, "# get the jenkins queue" which
> does not belong.
> I think a testcase is needed with a different MP in a downstream job in streamBuildingS cenarios: job_building_ with_different_ mp', mp'}, mp3'}]}]} mp3" and it is still active mp" is being
> TestIsJobOrDown
> ('downstream_
> {'expected': False,
> 'job_params': {'merge_proposal': 'http://
> 'jenkins_data': {
> 'builds': [{
> 'building': True,
> 'actions': [{
> 'causes': [{
> 'upstreamProject': 'job',
> 'upstreamBuild': 22
> }]
> }],
> 'result': None}],
> 'upstreamProjects': [{
> 'name': 'job',
> 'builds': [
> {
> 'number': 22,
> 'actions': [{'parameters': [{
> 'name': 'merge_proposal',
> 'value': 'http://
> ]}]}}),
>
> The scenario is that job was started with "http://
> in a downstream build (like generic-land). A new MP, "http://
> checked, no matching builds should be found. I'm guessing at the correct
> scenario, it may not be quite right.
Added.
> Some comments appear to be out of place: or_downstream_ building( ), the docstring refers to "the json job_running( ). or_downstream_ building( ) and _is_item_ queued_ by_upstream( ) are actions( ), there is a comment, "# get the jenkins queue" which
> - In is_job_
> request below" which is actually in is_downstream_
> - is_job_
> missing parameters and return value in the docstring.
> - In _get_build_
> does not belong.
Fixed.