Commit 8fd97193 authored by Quinten Yearsley's avatar Quinten Yearsley Committed by Commit Bot

Rename "buildbot" module to "results_fetcher"

This would also rename BuildBot class to TestResultsFetcher,
and rename the attribute buildbot to results_fetcher.

These classes have nothing to do with Buildbot, which is
no longer used. They do seem to be basically about fetching
results of tests that were run on bots.

Bug: 1002702
Change-Id: Ie877f4c16e8edde5023366a299dabb657a0ecd52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894618Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713977}
parent 23f0bf15
......@@ -31,7 +31,7 @@ import logging
from blinkpy.common.checkout.git import Git
from blinkpy.common.net import web
from blinkpy.common.net.buildbot import BuildBot
from blinkpy.common.net.results_fetcher import TestResultsFetcher
from blinkpy.common.system.system_host import SystemHost
from blinkpy.web_tests.builder_list import BuilderList
from blinkpy.web_tests.port.factory import PortFactory
......@@ -49,7 +49,7 @@ class Host(SystemHost):
self._git = None
# Everything below this line is WebKit-specific and belongs on a higher-level object.
self.buildbot = BuildBot()
self.results_fetcher = TestResultsFetcher()
# FIXME: Unfortunately Port objects are currently the central-dispatch objects of the NRWT world.
# In order to instantiate a port correctly, we have to pass it at least an executive, user, git, and filesystem
......
......@@ -27,7 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from blinkpy.common.checkout.git_mock import MockGit
from blinkpy.common.net.buildbot_mock import MockBuildBot
from blinkpy.common.net.results_fetcher_mock import MockTestResultsFetcher
from blinkpy.common.net.web_mock import MockWeb
from blinkpy.common.path_finder import PathFinder
from blinkpy.common.system.system_host_mock import MockSystemHost
......@@ -59,7 +59,7 @@ class MockHost(MockSystemHost):
self.web = web or MockWeb()
self._git = git
self.buildbot = MockBuildBot()
self.results_fetcher = MockTestResultsFetcher()
# Note: We're using a real PortFactory here. Tests which don't wish to depend
# on the list of known ports should override this with a MockPortFactory.
......
......@@ -14,7 +14,7 @@ import logging
import re
from blinkpy.common.checkout.git import Git
from blinkpy.common.net.buildbot import Build, filter_latest_builds
from blinkpy.common.net.results_fetcher import Build, filter_latest_builds
from blinkpy.common.net.luci_auth import LuciAuth
......
......@@ -5,7 +5,7 @@
import unittest
from blinkpy.common.host_mock import MockHost
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.net.git_cl import CLStatus
from blinkpy.common.net.git_cl import GitCL
from blinkpy.common.net.git_cl import SEARCHBUILDS_RESPONSE_PREFIX
......
......@@ -53,8 +53,8 @@ class Build(collections.namedtuple('Build', ('builder_name', 'build_number'))):
return super(Build, cls).__new__(cls, builder_name, build_number)
class BuildBot(object):
"""This class represents an interface to BuildBot-related functionality.
class TestResultsFetcher(object):
"""This class represents an interface to test results for particular builds.
This includes fetching web test results from Google Storage;
for more information about the web test result format, see:
......
......@@ -26,14 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from blinkpy.common.net.buildbot import BuildBot
from blinkpy.common.net.results_fetcher import TestResultsFetcher
# TODO(qyearsley): To be consistent with other fake ("mock") classes, this
# could be changed so it's not a subclass of BuildBot.
class MockBuildBot(BuildBot):
# could be changed so it's not a subclass of TestResultsFetcher.
class MockTestResultsFetcher(TestResultsFetcher):
def __init__(self):
super(MockBuildBot, self).__init__()
super(MockTestResultsFetcher, self).__init__()
self._canned_results = {}
self._canned_retry_summary_json = {}
self._webdriver_results = {}
......
......@@ -30,7 +30,7 @@ import json
import logging
import unittest
from blinkpy.common.net.buildbot import BuildBot, Build, filter_latest_builds
from blinkpy.common.net.results_fetcher import TestResultsFetcher, Build, filter_latest_builds
from blinkpy.common.net.web_mock import MockWeb
from blinkpy.common.system.log_testing import LoggingTestCase
......@@ -42,39 +42,39 @@ class BuilderTest(LoggingTestCase):
def test_results_url_no_build_number(self):
self.assertEqual(
BuildBot().results_url('Test Builder'),
TestResultsFetcher().results_url('Test Builder'),
'https://test-results.appspot.com/data/layout_results/Test_Builder/results/layout-test-results')
def test_results_url_with_build_number(self):
self.assertEqual(
BuildBot().results_url('Test Builder', 10),
TestResultsFetcher().results_url('Test Builder', 10),
'https://test-results.appspot.com/data/layout_results/Test_Builder/10/layout-test-results')
def test_results_url_with_build_number_step_name(self):
self.assertEqual(
BuildBot().results_url('Test Builder', 10,
TestResultsFetcher().results_url('Test Builder', 10,
'webkit_layout_tests (with patch)'),
'https://test-results.appspot.com/data/layout_results/Test_Builder'
'/10/webkit_layout_tests%20%28with%20patch%29/layout-test-results')
def test_results_url_with_non_numeric_build_number(self):
with self.assertRaisesRegexp(AssertionError, 'expected numeric build number'):
BuildBot().results_url('Test Builder', 'ba5eba11')
TestResultsFetcher().results_url('Test Builder', 'ba5eba11')
def test_builder_results_url_base(self):
self.assertEqual(
BuildBot().builder_results_url_base('WebKit Mac10.8 (dbg)'),
TestResultsFetcher().builder_results_url_base('WebKit Mac10.8 (dbg)'),
'https://test-results.appspot.com/data/layout_results/WebKit_Mac10_8__dbg_')
def test_accumulated_results_url(self):
self.assertEqual(
BuildBot().accumulated_results_url_base('WebKit Mac10.8 (dbg)'),
TestResultsFetcher().accumulated_results_url_base('WebKit Mac10.8 (dbg)'),
'https://test-results.appspot.com/data/layout_results/WebKit_Mac10_8__dbg_/results/layout-test-results')
def test_fetch_web_test_results_with_no_results_fetched(self):
buildbot = BuildBot()
buildbot.web = MockWeb()
results = buildbot.fetch_web_test_results(buildbot.results_url('B'))
fetcher = TestResultsFetcher()
fetcher.web = MockWeb()
results = fetcher.fetch_web_test_results(fetcher.results_url('B'))
self.assertIsNone(results)
self.assertLog([
'DEBUG: Got 404 response from:\n'
......@@ -82,8 +82,8 @@ class BuilderTest(LoggingTestCase):
])
def test_fetch_results_with_weird_step_name(self):
buildbot = BuildBot()
buildbot.web = MockWeb(urls={
fetcher = TestResultsFetcher()
fetcher.web = MockWeb(urls={
'https://test-results.appspot.com/testfile?buildnumber=123&'
'callback=ADD_RESULTS&builder=builder&name=full_results.json':
'ADD_RESULTS(%s);' % (json.dumps(
......@@ -94,19 +94,19 @@ class BuilderTest(LoggingTestCase):
'layout-test-results/failing_results.json':
json.dumps({'passed': True}),
})
results = buildbot.fetch_results(Build('builder', 123))
results = fetcher.fetch_results(Build('builder', 123))
self.assertEqual(results._results, { # pylint: disable=protected-access
'passed': True
})
self.assertLog([])
def test_fetch_results_without_build_number(self):
buildbot = BuildBot()
self.assertIsNone(buildbot.fetch_results(Build('builder', None)))
fetcher = TestResultsFetcher()
self.assertIsNone(fetcher.fetch_results(Build('builder', None)))
def test_get_step_name(self):
buildbot = BuildBot()
buildbot.web = MockWeb(urls={
fetcher = TestResultsFetcher()
fetcher.web = MockWeb(urls={
'https://test-results.appspot.com/testfile?buildnumber=5&'
'callback=ADD_RESULTS&builder=foo&name=full_results.json':
'ADD_RESULTS(%s);' % (json.dumps(
......@@ -115,33 +115,33 @@ class BuilderTest(LoggingTestCase):
{"TestType": "webkit_layout_tests (retry with patch)"},
{"TestType": "base_unittests (with patch)"}]))
})
step_name = buildbot.get_layout_test_step_name(Build('foo', 5))
step_name = fetcher.get_layout_test_step_name(Build('foo', 5))
self.assertEqual(step_name, 'webkit_layout_tests (with patch)')
self.assertLog([])
def test_get_step_name_without_build_number(self):
buildbot = BuildBot()
fetcher = TestResultsFetcher()
self.assertIsNone(
buildbot.get_layout_test_step_name(Build('builder', None)))
fetcher.get_layout_test_step_name(Build('builder', None)))
def test_fetch_webdriver_results_without_build_number(self):
buildbot = BuildBot()
self.assertIsNone(buildbot.fetch_webdriver_test_results(
fetcher = TestResultsFetcher()
self.assertIsNone(fetcher.fetch_webdriver_test_results(
Build('builder', None), 'bar'))
self.assertLog(
['DEBUG: Builder name or build number or master is None\n'])
def test_fetch_webdriver_results_without_master(self):
buildbot = BuildBot()
self.assertIsNone(buildbot.fetch_webdriver_test_results(
fetcher = TestResultsFetcher()
self.assertIsNone(fetcher.fetch_webdriver_test_results(
Build('builder', 1), ''))
self.assertLog(
['DEBUG: Builder name or build number or master is None\n'])
def test_fetch_webdriver_test_results_with_no_results(self):
buildbot = BuildBot()
buildbot.web = MockWeb()
results = buildbot.fetch_webdriver_test_results(
fetcher = TestResultsFetcher()
fetcher.web = MockWeb()
results = fetcher.fetch_webdriver_test_results(
Build('bar-rel', 123), 'foo.chrome')
self.assertIsNone(results)
self.assertLog([
......@@ -152,15 +152,15 @@ class BuilderTest(LoggingTestCase):
])
def test_fetch_webdriver_results_success(self):
buildbot = BuildBot()
buildbot.web = MockWeb(urls={
fetcher = TestResultsFetcher()
fetcher.web = MockWeb(urls={
'https://test-results.appspot.com/testfile?buildnumber=123&'
'master=foo.chrome&builder=bar-rel&'
'testtype=webdriver_tests_suite+%28with+patch%29&'
'name=full_results.json':
json.dumps({'passed': True}),
})
results = buildbot.fetch_webdriver_test_results(
results = fetcher.fetch_webdriver_test_results(
Build('bar-rel', 123), 'foo.chrome')
self.assertEqual(results._results, { # pylint: disable=protected-access
'passed': True
......@@ -168,7 +168,7 @@ class BuilderTest(LoggingTestCase):
self.assertLog([])
class BuildBotHelperFunctionTest(unittest.TestCase):
class TestResultsFetcherHelperFunctionTest(unittest.TestCase):
def test_filter_latest_jobs_empty(self):
self.assertEqual(filter_latest_builds([]), [])
......
......@@ -34,7 +34,7 @@ import re
from blinkpy.common.path_finder import WEB_TESTS_LAST_COMPONENT
from blinkpy.common.memoized import memoized
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.results_fetcher import Build
from blinkpy.tool.commands.command import Command
from blinkpy.web_tests.models import test_failures
from blinkpy.web_tests.models.test_expectations import TestExpectations
......@@ -312,7 +312,7 @@ class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand):
if options.results_directory:
args.extend(['--results-directory', options.results_directory])
step_name = self._tool.buildbot.get_layout_test_step_name(build)
step_name = self._tool.results_fetcher.get_layout_test_step_name(build)
if step_name:
args.extend(['--step-name', step_name])
......@@ -512,7 +512,7 @@ class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand):
def _result_for_test(self, test, build):
# We need full results to know if a test passed or was skipped.
# TODO(robertma): Make memoized support kwargs, and use full=True here.
results = self._tool.buildbot.fetch_results(build, True)
results = self._tool.results_fetcher.fetch_results(build, True)
if not results:
_log.debug('No results found for build %s', build)
return None
......
......@@ -218,7 +218,7 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
Returns:
A dict mapping Build to WebTestResults for all completed jobs.
"""
buildbot = self._tool.buildbot
results_fetcher = self._tool.results_fetcher
results = {}
for build, status in jobs.iteritems():
if status == TryJobStatus('COMPLETED', 'SUCCESS'):
......@@ -230,8 +230,8 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
# Only completed failed builds will contain actual failed
# web tests to download baselines for.
continue
results_url = buildbot.results_url(build.builder_name, build.build_number)
web_test_results = buildbot.fetch_results(build)
results_url = results_fetcher.results_url(build.builder_name, build.build_number)
web_test_results = results_fetcher.fetch_results(build)
if web_test_results is None:
_log.info('Failed to fetch results for "%s".', build.builder_name)
_log.info('Results URL: %s/results.html', results_url)
......@@ -345,8 +345,8 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
If the list of new failures could not be obtained, this returns None.
"""
buildbot = self._tool.buildbot
content = buildbot.fetch_retry_summary_json(build)
results_fetcher = self._tool.results_fetcher
content = results_fetcher.fetch_retry_summary_json(build)
if content is None:
return None
try:
......
......@@ -7,9 +7,9 @@ import optparse
import textwrap
from blinkpy.common.checkout.git_mock import MockGit
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.git_cl import TryJobStatus
from blinkpy.common.net.git_cl_mock import MockGitCL
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.net.web_test_results import WebTestResults
from blinkpy.common.path_finder import RELATIVE_WEB_TESTS
from blinkpy.common.system.log_testing import LoggingTestCase
......@@ -95,8 +95,8 @@ class RebaselineCLTest(BaseTestCase, LoggingTestCase):
})
for build in builds:
self.tool.buildbot.set_results(build, web_test_results)
self.tool.buildbot.set_retry_sumary_json(build, json.dumps({
self.tool.results_fetcher.set_results(build, web_test_results)
self.tool.results_fetcher.set_retry_sumary_json(build, json.dumps({
'failures': [
'one/flaky-fail.html',
'one/missing.html',
......@@ -344,7 +344,7 @@ class RebaselineCLTest(BaseTestCase, LoggingTestCase):
Build('MOCK Try Linux', 6000): TryJobStatus('COMPLETED', 'FAILURE'),
}
for build in builds:
self.tool.buildbot.set_retry_sumary_json(build, json.dumps({
self.tool.results_fetcher.set_retry_sumary_json(build, json.dumps({
'failures': ['one/text-fail.html'],
'ignored': ['two/image-fail.html'],
}))
......@@ -358,7 +358,7 @@ class RebaselineCLTest(BaseTestCase, LoggingTestCase):
def test_execute_with_no_retry_summary_downloaded(self):
# In this example, the retry summary could not be downloaded, so
# a warning is printed and all tests are rebaselined.
self.tool.buildbot.set_retry_sumary_json(
self.tool.results_fetcher.set_retry_sumary_json(
Build('MOCK Try Win', 5000), None)
exit_code = self.command.execute(self.command_options(), [], self.tool)
self.assertEqual(exit_code, 0)
......@@ -427,7 +427,7 @@ class RebaselineCLTest(BaseTestCase, LoggingTestCase):
])
def test_execute_missing_results_with_no_fill_missing_prompts(self):
self.tool.buildbot.set_results(Build('MOCK Try Win', 5000), None)
self.tool.results_fetcher.set_results(Build('MOCK Try Win', 5000), None)
exit_code = self.command.execute(self.command_options(), [], self.tool)
self.assertEqual(exit_code, 1)
self.assertLog([
......@@ -442,7 +442,7 @@ class RebaselineCLTest(BaseTestCase, LoggingTestCase):
])
def test_execute_missing_results_with_fill_missing_continues(self):
self.tool.buildbot.set_results(Build('MOCK Try Win', 5000), None)
self.tool.results_fetcher.set_results(Build('MOCK Try Win', 5000), None)
exit_code = self.command.execute(
self.command_options(fill_missing=True),
['one/flaky-fail.html'], self.tool)
......
......@@ -35,7 +35,7 @@ class RebaselineTest(AbstractRebaseliningCommand):
if options.results_directory:
results_url = 'file://' + options.results_directory
else:
results_url = self._tool.buildbot.results_url(
results_url = self._tool.results_fetcher.results_url(
options.builder, build_number=options.build_number,
step_name=options.step_name)
......
......@@ -6,7 +6,7 @@ import json
import optparse
import unittest
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.net.web_test_results import WebTestResults
from blinkpy.common.path_finder import RELATIVE_WEB_TESTS
from blinkpy.common.system.executive_mock import MockExecutive
......@@ -89,7 +89,7 @@ class BaseTestCase(unittest.TestCase):
def _setup_mock_build_data(self):
for builder in ['MOCK Win7', 'MOCK Win7 (dbg)', 'MOCK Mac10.11']:
self.tool.buildbot.set_results(Build(builder), WebTestResults({
self.tool.results_fetcher.set_results(Build(builder), WebTestResults({
'tests': {
'userscripts': {
'first-test.html': {
......@@ -190,7 +190,7 @@ class TestRebaseline(BaseTestCase):
}, **kwargs))
def test_rebaseline_test_passes_on_all_builders(self):
self.tool.buildbot.set_results(Build('MOCK Win7'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Win7'), WebTestResults({
'tests': {
'userscripts': {
'first-test.html': {
......@@ -482,7 +482,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
('Bug(x) [ Mac ] userscripts/skipped-test.html [ WontFix ]\n'
'Bug(y) [ Win ] userscripts/skipped-test.html [ Skip ]\n'))
self._write('userscripts/skipped-test.html', 'Dummy test contents')
self.tool.buildbot.set_results(Build('MOCK Mac10.11'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Mac10.11'), WebTestResults({
'tests': {
'userscripts': {
'skipped-test.html': {
......@@ -492,7 +492,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
}
}
}))
self.tool.buildbot.set_results(Build('MOCK Win7'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Win7'), WebTestResults({
'tests': {
'userscripts': {
'skipped-test.html': {
......@@ -519,7 +519,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
# Flaky expectations should be kept even if the test passes.
self._write(self.test_expectations_path, 'Bug(x) userscripts/flaky-test.html [ Pass Failure ]\n')
self._write('userscripts/flaky-test.html', 'Dummy test contents')
self.tool.buildbot.set_results(Build('MOCK Mac10.11'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Mac10.11'), WebTestResults({
'tests': {
'userscripts': {
'flaky-test.html': {
......@@ -545,7 +545,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
self._write(self.test_expectations_path, 'Bug(foo) userscripts/all-pass.html [ Failure ]\n')
self._write('userscripts/all-pass.html', 'Dummy test contents')
test_baseline_set = TestBaselineSet(self.tool)
self.tool.buildbot.set_results(Build('MOCK Mac10.11'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Mac10.11'), WebTestResults({
'tests': {
'userscripts': {
'all-pass.html': {
......@@ -572,7 +572,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
self._write('userscripts/all-pass.html', 'Dummy test contents')
test_baseline_set = TestBaselineSet(self.tool)
for builder in ['MOCK Win7', 'MOCK Win10', 'MOCK Mac10.10', 'MOCK Mac10.11', 'MOCK Precise', 'MOCK Trusty']:
self.tool.buildbot.set_results(Build(builder), WebTestResults({
self.tool.results_fetcher.set_results(Build(builder), WebTestResults({
'tests': {
'userscripts': {
'all-pass.html': {
......@@ -599,7 +599,7 @@ class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
self._write(self.test_expectations_path, 'Bug(foo) userscripts/all-pass.html [ Failure ]\n')
self._write('userscripts/all-pass.html', 'Dummy test contents')
test_baseline_set = TestBaselineSet(self.tool)
self.tool.buildbot.set_results(Build('MOCK Mac10.11'), WebTestResults({
self.tool.results_fetcher.set_results(Build('MOCK Mac10.11'), WebTestResults({
'tests': {
'userscripts': {
'all-pass.html': {
......
......@@ -17,9 +17,9 @@ import json
import logging
import re
from blinkpy.common.net.buildbot import current_build_link
from blinkpy.common.net.git_cl import GitCL
from blinkpy.common.net.network_transaction import NetworkTimeout
from blinkpy.common.net.results_fetcher import current_build_link
from blinkpy.common.path_finder import PathFinder
from blinkpy.common.system.executive import ScriptError
from blinkpy.common.system.log_utils import configure_logging
......
......@@ -7,11 +7,11 @@ import json
from blinkpy.common.checkout.git_mock import MockGit
from blinkpy.common.host_mock import MockHost
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.git_cl import CLStatus
from blinkpy.common.net.git_cl import TryJobStatus
from blinkpy.common.net.git_cl_mock import MockGitCL
from blinkpy.common.net.network_transaction import NetworkTimeout
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.path_finder import RELATIVE_WEB_TESTS
from blinkpy.common.system.executive_mock import MockCall
from blinkpy.common.system.executive_mock import MockExecutive
......
......@@ -131,14 +131,14 @@ class WPTExpectationsUpdater(object):
# All tests passed, so there should be no failing results.
return {}
test_result_list = [self.host.buildbot.fetch_results(build)]
test_result_list = [self.host.results_fetcher.fetch_results(build)]
has_webdriver_tests = self.host.builders.has_webdriver_tests_for_builder(
build.builder_name)
if has_webdriver_tests:
master = self.host.builders.master_for_builder(
build.builder_name)
test_result_list.append(
self.host.buildbot.fetch_webdriver_test_results(build, master))
self.host.results_fetcher.fetch_webdriver_test_results(build, master))
test_result_list = filter(None, test_result_list)
if not test_result_list:
......
......@@ -6,10 +6,10 @@ import copy
import json
from blinkpy.common.host_mock import MockHost
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.buildbot_mock import MockBuildBot
from blinkpy.common.net.git_cl import TryJobStatus
from blinkpy.common.net.git_cl_mock import MockGitCL
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.net.results_fetcher_mock import MockTestResultsFetcher
from blinkpy.common.net.web_test_results import WebTestResult, WebTestResults
from blinkpy.common.system.executive import ScriptError
from blinkpy.common.system.log_testing import LoggingTestCase
......@@ -107,7 +107,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
# results are for the other builders since we shouldn't need to even
# fetch results, since the try job status already tells us that all
# of the tests passed.
host.buildbot.set_results(
host.results_fetcher.set_results(
Build('MOCK Try Mac10.10', 333),
WebTestResults({
'tests': {
......@@ -127,7 +127,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
self.assertEqual(0, updater.run(args=[]))
# Results are only fetched for failing builds.
self.assertEqual(host.buildbot.fetched_builds, [Build('MOCK Try Mac10.10', 333)])
self.assertEqual(host.results_fetcher.fetched_builds, [Build('MOCK Try Mac10.10', 333)])
self.assertEqual(
host.filesystem.read_text_file(expectations_path),
......@@ -136,7 +136,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
def test_get_failing_results_dict_only_passing_results(self):
host = self.mock_host()
host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
'tests': {
'external': {
'wpt': {
......@@ -156,7 +156,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
def test_get_failing_results_dict_unexpected_pass(self):
host = self.mock_host()
host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
'tests': {
'external': {
'wpt': {
......@@ -177,15 +177,15 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
def test_get_failing_results_dict_no_results(self):
host = self.mock_host()
host.buildbot = MockBuildBot()
host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), None)
host.results_fetcher = MockTestResultsFetcher()
host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), None)
updater = WPTExpectationsUpdater(host)
self.assertEqual(
updater.get_failing_results_dict(Build('MOCK Try Mac10.10', 123)), {})
def test_get_failing_results_dict_some_failing_results(self):
host = self.mock_host()
host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
'tests': {
'external': {
'wpt': {
......@@ -216,7 +216,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
def test_get_failing_results_dict_non_wpt_test(self):
host = self.mock_host()
host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), WebTestResults({
'tests': {
'x': {
'failing-test.html': {
......@@ -233,7 +233,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
def test_get_failing_results_dict_webdriver_failing_results_(self):
host = self.mock_host()
host.buildbot.set_results(Build('MOCK Try Trusty', 123), WebTestResults({
host.results_fetcher.set_results(Build('MOCK Try Trusty', 123), WebTestResults({
'tests': {
'external': {
'wpt': {
......@@ -249,7 +249,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
},
}))
host.buildbot.set_webdriver_test_results(Build('MOCK Try Trusty', 123), "tryserver.blink", WebTestResults({
host.results_fetcher.set_webdriver_test_results(Build('MOCK Try Trusty', 123), "tryserver.blink", WebTestResults({
'tests': {
'external': {
'wpt': {
......
......@@ -48,14 +48,14 @@ class BuilderList(object):
Valid values for the version specifier can be found in
TestExpectationsParser._configuration_tokens_list, and valid
values for the build type specifier include "Release" and "Debug".
"is_try_builder": Whether the builder is a try bot.
"is_try_builder": Whether the builder is a trybot.
"master": The master name of the builder. It is deprecated, but still required
by test-results.appspot.com API."
"has_webdriver_tests": Whether webdriver_tests_suite runs on this builder.
Possible refactoring note: Potentially, it might make sense to use
blinkpy.common.buildbot.Builder and add port_name and specifiers
properties to that class.
blinkpy.common.net.results_fetcher.Builder and add port_name and
specifiers properties to that class.
"""
self._builders = builders_dict
for builder in builders_dict:
......
......@@ -118,12 +118,12 @@ class TryFlag(object):
self._host.print_('Fetching results...')
# TODO: Get jobs from the _tryflag branch. Current branch for now.
jobs = self._git_cl.latest_try_jobs(builder_names=BUILDER_CONFIGS.keys())
buildbot = self._host.buildbot
results_fetcher = self._host.results_fetcher
for build in sorted(jobs):
self._host.print_('-- %s: %s/results.html' % (
BUILDER_CONFIGS[build.builder_name].version,
buildbot.results_url(build.builder_name, build.build_number)))
results = buildbot.fetch_results(build, True)
results_fetcher.results_url(build.builder_name, build.build_number)))
results = results_fetcher.fetch_results(build, True)
results.for_each_test(
lambda result, b=build: self._process_result(b, result))
......
......@@ -5,9 +5,9 @@
import unittest
from blinkpy.common.host_mock import MockHost
from blinkpy.common.net.buildbot import Build
from blinkpy.common.net.git_cl import TryJobStatus
from blinkpy.common.net.git_cl_mock import MockGitCL
from blinkpy.common.net.results_fetcher import Build
from blinkpy.common.net.web_test_results import WebTestResults
from blinkpy.common.path_finder import PathFinder
from blinkpy.web_tests.try_flag import TryFlag
......@@ -68,8 +68,8 @@ class TryFlagTest(unittest.TestCase):
self._run_trigger_test(regenerate=False)
self._run_trigger_test(regenerate=True)
def _setup_mock_results(self, buildbot):
buildbot.set_results(self.linux_build, WebTestResults({
def _setup_mock_results(self, results_fetcher):
results_fetcher.set_results(self.linux_build, WebTestResults({
'tests': {
'something': {
'fail-everywhere.html': {
......@@ -85,7 +85,7 @@ class TryFlagTest(unittest.TestCase):
}
}
}))
buildbot.set_results(self.win_build, WebTestResults({
results_fetcher.set_results(self.win_build, WebTestResults({
'tests': {
'something': {
'fail-everywhere.html': {
......@@ -101,7 +101,7 @@ class TryFlagTest(unittest.TestCase):
}
}
}))
buildbot.set_results(self.mac_build, WebTestResults({
results_fetcher.set_results(self.mac_build, WebTestResults({
'tests': {
'something': {
'pass-unexpectedly-mac.html': {
......@@ -129,7 +129,7 @@ class TryFlagTest(unittest.TestCase):
flag_expectations_file,
'something/pass-unexpectedly-mac.html [ Fail ]')
self._setup_mock_results(host.buildbot)
self._setup_mock_results(host.results_fetcher)
cmd = ['update', '--flag=--foo']
TryFlag(cmd, host, MockGitCL(host, self.mock_try_results)).run()
......@@ -163,7 +163,7 @@ class TryFlagTest(unittest.TestCase):
finder = PathFinder(filesystem)
flag_expectations_file = finder.path_from_web_tests(
'FlagExpectations', 'foo')
self._setup_mock_results(host.buildbot)
self._setup_mock_results(host.results_fetcher)
cmd = ['update', '--flag=--foo']
# Unexpected passes that don't have flag-specific failure expectations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment