Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/test/test_endpoint_triggerCI.py
Show First 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | def test_triggerCI_some_build_queued(self): | ||||
], | ], | ||||
[ | [ | ||||
"build-1", | "build-1", | ||||
"build-2", | "build-2", | ||||
"build-3", | "build-3", | ||||
] | ] | ||||
) | ) | ||||
def test_triggerCI_explicit_agent_pool(self): | |||||
def assert_teamcity_queued_builds(comments, queued_builds): | |||||
self.set_transaction_return_value(comments) | |||||
response = self.call_endpoint() | |||||
expected_calls = [ | |||||
call( | |||||
"BitcoinABC_BitcoinAbcStaging", | |||||
"refs/tags/phabricator/diff/{}".format(self.diff_id), | |||||
properties=[{ | |||||
'name': 'env.ABC_BUILD_NAME', | |||||
'value': build_id, | |||||
}, { | |||||
'agent': { | |||||
'pool': { | |||||
'id': 1, | |||||
}, | |||||
}, | |||||
}] | |||||
) | |||||
for build_id in queued_builds | |||||
] | |||||
print(expected_calls) | |||||
self.teamcity.trigger_build.assert_has_calls( | |||||
expected_calls, any_order=True) | |||||
self.assertEqual(response.status_code, 200) | |||||
# build-tsan should explicitly set the agent build pool | |||||
assert_teamcity_queued_builds( | |||||
[ | |||||
"@bot build-tsan", | |||||
], | |||||
[ | |||||
"build-tsan", | |||||
] | |||||
) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
unittest.main() | unittest.main() |