本文整理匯總了Python中webkitpy.common.net.buildbot.Build類的典型用法代碼示例。如果您正苦於以下問題:Python Build類的具體用法?Python Build怎麽用?Python Build使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Build類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _mock_fetch_build
def _mock_fetch_build(build_number):
build = Build(
builder=self.builder, build_number=build_number, revision=build_number + 1000, is_green=build_number < 4
)
parsed_results = {LayoutTestResults.fail_key: failure(build_number)}
build._layout_test_results = LayoutTestResults(parsed_results)
return build
示例2: test_layout_test_results
def test_layout_test_results(self):
buildbot = BuildBot()
builder = Builder(u"Foo Builder (test)", buildbot)
builder._fetch_file_from_results = lambda results_url, file_name: None
build = Build(builder, None, None, None)
# Test that layout_test_results() returns None if the fetch fails.
self.assertEqual(build.layout_test_results(), None)
示例3: _build_from_fake
def _build_from_fake(self, fake_builder, index):
if index >= len(fake_builder):
return None
fake_build = fake_builder[index]
build = Build(builder=fake_builder, build_number=index, revision=fake_build[0], is_green=fake_build[1])
def mock_previous_build():
return self._build_from_fake(fake_builder, index + 1)
build.previous_build = mock_previous_build
return build
示例4: _mock_fetch_build
def _mock_fetch_build(build_number):
build = Build(
builder=self.builder,
build_number=build_number,
revision=build_number + 1000,
is_green=build_number < 4
)
results = [self._mock_test_result(testname) for testname in failure(build_number)]
layout_test_results = LayoutTestResults(test_results=results, did_exceed_test_failure_limit=False)
def mock_layout_test_results():
return layout_test_results
build.layout_test_results = mock_layout_test_results
return build
示例5: latest_try_jobs
def latest_try_jobs(self, issue_number, builder_names=None, patchset_number=None):
"""Returns a list of Build objects for builds on the latest patchset.
Args:
issue_number: A Rietveld issue number.
builder_names: A collection of builder names. If specified, only results
from the given list of builders will be kept.
patchset_number: If given, a specific patchset will be used instead of the latest one.
Returns:
A list of Build objects, where Build objects for completed jobs have a build number,
and Build objects for pending jobs have no build number.
"""
try:
if patchset_number:
url = self._patchset_url(issue_number, patchset_number)
else:
url = self._latest_patchset_url(issue_number)
patchset_data = self._get_json(url)
except (urllib2.URLError, ValueError):
return []
builds = []
for result_dict in patchset_data["try_job_results"]:
build = Build(result_dict["builder"], result_dict["buildnumber"])
# Normally, a value of -1 or 6 in the "result" field indicates the job is
# started or pending, and the "buildnumber" field is null.
if build.build_number and result_dict["result"] in (-1, 6):
_log.warning(
"Build %s has result %d, but unexpectedly has a build number.", build, result_dict["result"]
)
build.build_number = None
builds.append(build)
if builder_names is not None:
builds = [b for b in builds if b.builder_name in builder_names]
return self._filter_latest_builds(builds)
示例6: test_results_zip_url
def test_results_zip_url(self):
b = Build(None, 123, 123, False)
b.results_url = self.results_url
self.assertEqual("some-url.zip", b.results_zip_url())
示例7: test_results
def test_results(self):
builder = Builder("builder", BuildBot())
b = Build(builder, 123, 123, True)
self.assertTrue(b.results())