本文整理汇总了Python中mozregression.json_pushes.JsonPushes.json_pushes_url方法的典型用法代码示例。如果您正苦于以下问题:Python JsonPushes.json_pushes_url方法的具体用法?Python JsonPushes.json_pushes_url怎么用?Python JsonPushes.json_pushes_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozregression.json_pushes.JsonPushes
的用法示例。
在下文中一共展示了JsonPushes.json_pushes_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_merge
# 需要导入模块: from mozregression.json_pushes import JsonPushes [as 别名]
# 或者: from mozregression.json_pushes.JsonPushes import json_pushes_url [as 别名]
def handle_merge(self):
# let's check if we are facing a merge, and in that case,
# continue the bisection from the merged branch.
result = None
self._logger.debug("Starting merge handling...")
# we have to check the commit of the most recent push
most_recent_push = self.build_range[1]
jp = JsonPushes(most_recent_push.repo_name)
push = jp.pushlog_for_change(most_recent_push.changeset, full='1')
msg = push['changesets'][-1]['desc']
self._logger.debug("Found commit message:\n%s\n" % msg)
branch = find_branch_in_merge_commit(msg)
if not (branch and len(push['changesets']) >= 2):
return
try:
# so, this is a merge. We can find the oldest and youngest
# changesets, and the branch where the merge comes from.
oldest = push['changesets'][0]['node']
# exclude the merge commit
youngest = push['changesets'][-2]['node']
self._logger.debug("This is a merge from %s" % branch)
# we can't use directly the youngest changeset because we
# don't know yet if it is good.
#
# PUSH1 PUSH2
# [1 2] [3 4 5 6 7]
# G MERGE B
#
# so first, grab it. This needs to be done on the right branch.
jp2 = JsonPushes(branch)
raw = [int(i) for i in
jp2.pushlog_within_changes(oldest, youngest, raw=True)]
data = jp2._request(jp2.json_pushes_url(
startID=str(min(raw) - 2),
endID=str(max(raw)),
))
datakeys = [int(i) for i in data]
oldest = data[str(min(datakeys))]["changesets"][0]
youngest = data[str(max(datakeys))]["changesets"][-1]
# we are ready to bisect further
self._logger.info("************* Switching to %s" % branch)
gr, br = self._reverse_if_find_fix(oldest, youngest)
result = (branch, gr, br)
except MozRegressionError:
self._logger.debug("Got exception", exc_info=True)
raise MozRegressionError(
"Unable to exploit the merge commit. Origin branch is {}, and"
" the commit message for {} was:\n{}".format(
most_recent_push.repo_name,
most_recent_push.short_changeset,
msg
)
)
self._logger.debug('End merge handling')
return result
示例2: test_json_pushes_url
# 需要导入模块: from mozregression.json_pushes import JsonPushes [as 别名]
# 或者: from mozregression.json_pushes.JsonPushes import json_pushes_url [as 别名]
def test_json_pushes_url(branch, chsetskwargs, result_url):
jpushes = JsonPushes(branch=branch)
assert jpushes.json_pushes_url(**chsetskwargs) == result_url