Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py

Issue 2692423005: rebaseline-cl: Get latest try jobs using git-cl when no --issue given. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 10 matching lines...) Expand all
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 import unittest 29 import unittest
30 30
31 from webkitpy.common.net.buildbot import BuildBot 31 from webkitpy.common.net.buildbot import BuildBot, Build, filter_latest_builds
32 32
33 33
34 class BuilderTest(unittest.TestCase): 34 class BuilderTest(unittest.TestCase):
35 35
36 def test_results_url_no_build_number(self): 36 def test_results_url_no_build_number(self):
37 self.assertEqual( 37 self.assertEqual(
38 BuildBot().results_url('Test Builder'), 38 BuildBot().results_url('Test Builder'),
39 'https://storage.googleapis.com/chromium-layout-test-archives/Test_B uilder/results/layout-test-results') 39 'https://storage.googleapis.com/chromium-layout-test-archives/Test_B uilder/results/layout-test-results')
40 40
41 def test_results_url_with_build_number(self): 41 def test_results_url_with_build_number(self):
42 self.assertEqual( 42 self.assertEqual(
43 BuildBot().results_url('Test Builder', 10), 43 BuildBot().results_url('Test Builder', 10),
44 'https://storage.googleapis.com/chromium-layout-test-archives/Test_B uilder/10/layout-test-results') 44 'https://storage.googleapis.com/chromium-layout-test-archives/Test_B uilder/10/layout-test-results')
45 45
46 def test_builder_results_url_base(self): 46 def test_builder_results_url_base(self):
47 self.assertEqual( 47 self.assertEqual(
48 BuildBot().builder_results_url_base('WebKit Mac10.8 (dbg)'), 48 BuildBot().builder_results_url_base('WebKit Mac10.8 (dbg)'),
49 'https://storage.googleapis.com/chromium-layout-test-archives/WebKit _Mac10_8__dbg_') 49 'https://storage.googleapis.com/chromium-layout-test-archives/WebKit _Mac10_8__dbg_')
50 50
51 def test_accumulated_results_url(self): 51 def test_accumulated_results_url(self):
52 self.assertEqual( 52 self.assertEqual(
53 BuildBot().accumulated_results_url_base('WebKit Mac10.8 (dbg)'), 53 BuildBot().accumulated_results_url_base('WebKit Mac10.8 (dbg)'),
54 'https://storage.googleapis.com/chromium-layout-test-archives/WebKit _Mac10_8__dbg_/results/layout-test-results') 54 'https://storage.googleapis.com/chromium-layout-test-archives/WebKit _Mac10_8__dbg_/results/layout-test-results')
55 55
56 def fetch_layout_test_results_with_no_responses(self): 56 def fetch_layout_test_results_with_no_responses(self):
57 buildbot = BuildBot() 57 buildbot = BuildBot()
58 buildbot._fetch_file = lambda: None # pylint: disable=protected-access 58 buildbot._fetch_file = lambda: None # pylint: disable=protected-access
59 self.assertIsNone(buildbot.fetch_layout_test_results(buildbot.results_ur l('Builder'))) 59 self.assertIsNone(buildbot.fetch_layout_test_results(buildbot.results_ur l('Builder')))
60
61
62 class BuildBotHelperFunctionTest(unittest.TestCase):
63
64 def test_filter_latest_jobs_empty(self):
65 self.assertEqual(filter_latest_builds([]), [])
66
67 def test_filter_latest_jobs_higher_build_first(self):
68 self.assertEqual(
69 filter_latest_builds([Build('foo', 5), Build('foo', 3), Build('bar', 5)]),
70 [Build('bar', 5), Build('foo', 5)])
71
72 def test_filter_latest_jobs_higher_build_last(self):
73 self.assertEqual(
74 filter_latest_builds([Build('foo', 3), Build('bar', 5), Build('foo', 5)]),
75 [Build('bar', 5), Build('foo', 5)])
76
77 def test_filter_latest_jobs_no_build_number(self):
78 self.assertEqual(
79 filter_latest_builds([Build('foo', 3), Build('bar'), Build('bar')]),
80 [Build('bar'), Build('foo', 3)])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698