本文整理汇总了Python中webkitpy.tool.bot.flakytestreporter.FlakyTestReporter类的典型用法代码示例。如果您正苦于以下问题:Python FlakyTestReporter类的具体用法?Python FlakyTestReporter怎么用?Python FlakyTestReporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FlakyTestReporter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
def execute(self, options, args, tool):
reporter = FlakyTestReporter(tool, "webkitpy")
search_string = args[0]
bug = reporter._lookup_bug_for_flaky_test(search_string)
if bug:
bug = reporter._follow_duplicate_chain(bug)
print "%5s %s" % (bug.id(), bug.title())
else:
print "No bugs found matching '%s'" % search_string
示例2: test_find_in_archive
def test_find_in_archive(self):
reporter = FlakyTestReporter(MockTool(), 'dummy-queue')
class MockZipFile(object):
def namelist(self):
return ["tmp/layout-test-results/foo/bar-diffs.txt"]
reporter._find_in_archive("foo/bar-diffs.txt", MockZipFile())
# This is not ideal, but its
reporter._find_in_archive("txt", MockZipFile())
示例3: test_report_flaky_tests_creating_bug
def test_report_flaky_tests_creating_bug(self):
tool = MockTool()
tool.filesystem = MockFileSystem({"/mock-results/foo/bar-diffs.txt": "mock"})
tool.status_server = MockStatusServer(bot_id="mock-bot-id")
reporter = FlakyTestReporter(tool, 'dummy-queue')
reporter._lookup_bug_for_flaky_test = lambda bug_id: None
patch = tool.bugs.fetch_attachment(10000)
expected_logs = """Bug does not already exist for foo/bar.html, creating.
MOCK create_bug
bug_title: Flaky Test: foo/bar.html
bug_description: This is an automatically generated bug from the dummy-queue.
foo/bar.html has been flaky on the dummy-queue.
foo/bar.html was authored by [email protected]
http://trac.webkit.org/browser/trunk/LayoutTests/foo/bar.html
The dummy-queue just saw foo/bar.html flake (text diff) while processing attachment 10000 on bug 50000.
Bot: mock-bot-id Port: MockPort Platform: MockPlatform 1.0
The bots will update this with information from each new failure.
If you believe this bug to be fixed or invalid, feel free to close. The bots will re-open if the flake re-occurs.
If you would like to track this test fix with another bug, please close this bug as a duplicate. The bots will follow the duplicate chain when making future comments.
component: Tools / Tests
cc: [email protected]
blocked: 50856
MOCK add_attachment_to_bug: bug_id=60001, description=Failure diff from mock-bot-id filename=failure.diff mimetype=None
MOCK bug comment: bug_id=50000, cc=None
--- Begin comment ---
The dummy-queue encountered the following flaky tests while processing attachment 10000:
foo/bar.html bug 60001 (author: [email protected])
The dummy-queue is continuing to process your patch.
--- End comment ---
"""
test_results = [self._mock_test_result('foo/bar.html')]
class MockZipFile(object):
def read(self, path):
return ""
def namelist(self):
return ['foo/bar-diffs.txt']
OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [patch, test_results, MockZipFile()], expected_logs=expected_logs)
示例4: test_report_flaky_tests_creating_bug
def test_report_flaky_tests_creating_bug(self):
tool = MockTool()
tool.filesystem = MockFileSystem({"/mock/foo/bar-diffs.txt": "mock"})
tool.status_server = MockStatusServer(bot_id="mock-bot-id")
reporter = FlakyTestReporter(tool, 'dummy-queue')
reporter._lookup_bug_for_flaky_test = lambda bug_id: None
patch = tool.bugs.fetch_attachment(197)
expected_stderr = """MOCK create_bug
bug_title: Flaky Test: foo/bar.html
bug_description: This is an automatically generated bug from the dummy-queue.
foo/bar.html has been flaky on the dummy-queue.
foo/bar.html was authored by [email protected]
http://trac.webkit.org/browser/trunk/LayoutTests/foo/bar.html
The dummy-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
Bot: mock-bot-id Port: MockPort Platform: MockPlatform 1.0
The bots will update this with information from each new failure.
If you believe this bug to be fixed or invalid, feel free to close. The bots will re-open if the flake re-occurs.
If you would like to track this test fix with another bug, please close this bug as a duplicate. The bots will follow the duplicate chain when making future comments.
component: Tools / Tests
cc: [email protected]
blocked: 50856
MOCK add_attachment_to_bug: bug_id=78, description=Failure diff from mock-bot-id filename=failure.diff
MOCK bug comment: bug_id=42, cc=None
--- Begin comment ---
The dummy-queue encountered the following flaky tests while processing attachment 197:
foo/bar.html bug 78 (author: [email protected])
The dummy-queue is continuing to process your patch.
--- End comment ---
"""
OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [['foo/bar.html'], patch], expected_stderr=expected_stderr)
示例5: report_flaky_tests
def report_flaky_tests(self, patch, flaky_test_results, results_archive=None):
reporter = FlakyTestReporter(self._tool, self.name)
reporter.report_flaky_tests(patch, flaky_test_results, results_archive)
示例6: test_bot_information
def test_bot_information(self):
tool = MockTool()
tool.status_server = MockStatusServer("MockBotId")
reporter = FlakyTestReporter(tool, 'dummy-queue')
self.assertEqual(reporter._bot_information(), "Bot: MockBotId Port: MockPort Platform: MockPlatform 1.0")
示例7: test_follow_duplicate_chain
def test_follow_duplicate_chain(self):
tool = MockTool()
reporter = FlakyTestReporter(tool, 'dummy-queue')
bug = tool.bugs.fetch_bug(78)
self.assertEqual(reporter._follow_duplicate_chain(bug).id(), 76)
示例8: _assert_emails_for_test
def _assert_emails_for_test(self, emails):
tool = MockTool()
reporter = FlakyTestReporter(tool, 'dummy-queue')
commit_infos = [MockCommitInfo(email) for email in emails]
tool.checkout().recent_commit_infos_for_files = lambda paths: set(commit_infos)
self.assertEqual(reporter._author_emails_for_test([]), set(emails))
示例9: test_results_diff_path_for_test
def test_results_diff_path_for_test(self):
reporter = FlakyTestReporter(MockTool(), 'dummy-queue')
self.assertEqual(reporter._results_diff_path_for_test("test.html"), "/mock/test-diffs.txt")
示例10: test_optional_author_string
def test_optional_author_string(self):
reporter = FlakyTestReporter(MockTool(), 'dummy-queue')
self.assertEqual(reporter._optional_author_string([]), "")
self.assertEqual(reporter._optional_author_string(["[email protected]"]), " (author: [email protected])")
self.assertEqual(reporter._optional_author_string(["[email protected]", "[email protected]"]), " (authors: [email protected] and [email protected])")