Fixed some unexpected syntax for chrome bots.
BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/569017 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2246 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
		| @@ -81,7 +81,7 @@ def parse_tgrid_page(html): | ||||
|   """ | ||||
|   result = {} | ||||
|  | ||||
|   for match in re.finditer('<td.*?class="sourcestamp">(\d+)  </td>(.*?)</tr>', | ||||
|   for match in re.finditer('<td.*?class="sourcestamp">(\d+).*?</td>(.*?)</tr>', | ||||
|                            html, re.DOTALL): | ||||
|     revision = match.group(1) | ||||
|     builds_for_revision_html = match.group(2) | ||||
|   | ||||
| @@ -492,6 +492,15 @@ MINIMAL_EXCEPTION_SLAVE_LOST = """ | ||||
| </tr> | ||||
| """ | ||||
|  | ||||
| MINIMAL_IN_TRUNK_SOURCESTAMP = """ | ||||
| <tr> | ||||
| <td valign="bottom" class="sourcestamp">1576 in trunk </td> | ||||
| <td class="build retry"> | ||||
|   <a href="builders/LinuxValgrind/builds/324">build<br/>successful<br/>exception<br/>slave<br/>lost</a> | ||||
| </td> | ||||
| </tr> | ||||
| """ | ||||
|  | ||||
| class TGridParserTest(unittest.TestCase): | ||||
|   def test_parser_throws_exception_on_empty_html(self): | ||||
|     self.assertRaises(tgrid_parser.FailedToParseBuildStatus, | ||||
| @@ -554,6 +563,17 @@ class TGridParserTest(unittest.TestCase): | ||||
|     self.assertEqual('1576--LinuxValgrind', first_mapping[0]) | ||||
|     self.assertEqual('324--failed', first_mapping[1]) | ||||
|  | ||||
|   def test_parser_finds_exception_slave_lost_and_maps_to_failed(self): | ||||
|     # Sometimes the transposed grid says "in trunk" in the source stamp, so | ||||
|     # make sure we deal with that. | ||||
|     result = tgrid_parser.parse_tgrid_page(MINIMAL_IN_TRUNK_SOURCESTAMP) | ||||
|  | ||||
|     self.assertEqual(1, len(result), 'There is only one bot in the sample.') | ||||
|     first_mapping = result.items()[0] | ||||
|  | ||||
|     self.assertEqual('1576--LinuxValgrind', first_mapping[0]) | ||||
|     self.assertEqual('324--failed', first_mapping[1]) | ||||
|  | ||||
|   def test_parser_finds_all_bots_and_revisions_except_forced_builds(self): | ||||
|     result = tgrid_parser.parse_tgrid_page(SAMPLE_FILE) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 phoglund@webrtc.org
					phoglund@webrtc.org