def test_fetch_layout_test_results_with_no_results_fetched(self): buildbot = BuildBot() def fetch_file(url): return None if url.endswith('failing_results.json') else 'contents' buildbot.fetch_file = fetch_file results = buildbot.fetch_layout_test_results(buildbot.results_url('B')) self.assertIsNone(results) self.assertLog([ 'DEBUG: Got 404 response from:\n' 'https://test-results.appspot.com/data/layout_results/B/results/layout-test-results/failing_results.json\n' ])
def test_get_step_name(self): buildbot = BuildBot() def fetch_file(_): return ('ADD_RESULTS(%s);' % (json.dumps( [{"TestType": "webkit_layout_tests (with patch)"}, {"TestType": "not_site_per_process_webkit_layout_tests (with patch)"}, {"TestType": "webkit_layout_tests (retry with patch)"}, {"TestType": "base_unittests (with patch)"}]))) buildbot.fetch_file = fetch_file step_name = buildbot.get_layout_test_step_name(Build('foo', 5)) self.assertEqual(step_name, 'webkit_layout_tests (with patch)') self.assertLog([])
def test_fetch_layout_test_results_weird_step_name(self): buildbot = BuildBot() def fetch_file(url): if '/testfile' in url: return ('ADD_RESULTS(%s);' % (json.dumps( [{"TestType": "webkit_layout_tests on Intel GPU (with patch)"}, {"TestType": "base_unittests (with patch)"}]))) return json.dumps({'passed': True}) if url.endswith('failing_results.json') else 'deadbeef' buildbot.fetch_file = fetch_file results = buildbot.fetch_results(Build('builder', 123)) self.assertEqual(results._results, { # pylint: disable=protected-access 'passed': True }) self.assertLog([])