def setUp(self): LoggingTestCase.setUp(self) # We can pass an error-message swallower here because error message # output is tested instead in the end-to-end test case above. configuration = StyleProcessorConfiguration( filter_configuration=FilterConfiguration(), max_reports_per_category={"whitespace/newline": 1}, min_confidence=3, output_format="vs7", stderr_write=self._swallow_stderr_message) mock_carriage_checker_class = self._create_carriage_checker_class() mock_dispatcher = self.MockDispatcher() # We do not need to use a real incrementer here because error-count # incrementing is tested instead in the end-to-end test case above. mock_increment_error_count = self._do_nothing processor = StyleProcessor(configuration=configuration, mock_carriage_checker_class=mock_carriage_checker_class, mock_dispatcher=mock_dispatcher, mock_increment_error_count=mock_increment_error_count) self._configuration = configuration self._mock_dispatcher = mock_dispatcher self._processor = processor
def setUp(self): LoggingTestCase.setUp(self) # FIXME: This should be a MockFileSystem once TextFileReader is moved entirely on top of FileSystem. self.filesystem = FileSystem() self._temp_dir = str(self.filesystem.mkdtemp()) self._processor = TextFileReaderTest.MockProcessor() self._file_reader = TextFileReader(self.filesystem, self._processor)
def setUp(self): BaseTestCase.setUp(self) LoggingTestCase.setUp(self) web = MockWeb(urls={ 'https://codereview.chromium.org/api/11112222': json.dumps({ 'patchsets': [1, 2], }), 'https://codereview.chromium.org/api/11112222/2': json.dumps({ 'try_job_results': [ { 'builder': 'MOCK Try Win', 'buildnumber': 5000, 'result': 0, }, { 'builder': 'MOCK Try Mac', 'buildnumber': 4000, 'result': 0, }, ], 'files': { 'third_party/WebKit/LayoutTests/fast/dom/prototype-inheritance.html': {'status': 'M'}, 'third_party/WebKit/LayoutTests/fast/dom/prototype-taco.html': {'status': 'M'}, }, }), }) self.tool.builders = BuilderList({ "MOCK Try Win": { "port_name": "test-win-win7", "specifiers": ["Win7", "Release"], "is_try_builder": True, }, "MOCK Try Linux": { "port_name": "test-mac-mac10.10", "specifiers": ["Mac10.10", "Release"], "is_try_builder": True, }, }) self.command.rietveld = Rietveld(web) self.tool.buildbot.set_retry_sumary_json(Build('MOCK Try Win', 5000), json.dumps({ 'failures': [ 'fast/dom/prototype-newtest.html', 'fast/dom/prototype-taco.html', 'fast/dom/prototype-inheritance.html', 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html', ], 'ignored': [], })) # Write to the mock filesystem so that these tests are considered to exist. port = self.mac_port tests = [ 'fast/dom/prototype-taco.html', 'fast/dom/prototype-inheritance.html', 'fast/dom/prototype-newtest.html', 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html', ] for test in tests: self._write(port.host.filesystem.join(port.layout_tests_dir(), test), 'contents')
def setUp(self): LoggingTestCase.setUp(self) processor = TextFileReaderTest.MockProcessor() temp_dir = tempfile.mkdtemp() self._file_reader = TextFileReader(processor) self._processor = processor self._temp_dir = temp_dir
def setUp(self): LoggingTestCase.setUp(self) self._messages = []
def setUp(self): LoggingTestCase.setUp(self) self.warning_messages = ""
def setUp(self): BaseTestCase.setUp(self) LoggingTestCase.setUp(self) web = MockWeb(urls={ 'https://codereview.chromium.org/api/11112222': json.dumps({ 'patchsets': [1, 2], }), 'https://codereview.chromium.org/api/11112222/2': json.dumps({ 'try_job_results': [ { 'builder': 'MOCK Try Win', 'buildnumber': 5000, 'result': 0, }, { 'builder': 'MOCK Try Mac', 'buildnumber': 4000, 'result': 0, }, ], 'files': { 'third_party/WebKit/LayoutTests/fast/dom/prototype-inheritance.html': {'status': 'M'}, 'third_party/WebKit/LayoutTests/fast/dom/prototype-taco.html': {'status': 'M'}, }, }), }) self.tool.builders = BuilderList({ "MOCK Try Win": { "port_name": "test-win-win7", "specifiers": ["Win7", "Release"], "is_try_builder": True, }, "MOCK Try Linux": { "port_name": "test-linux-trusty", "specifiers": ["Trusty", "Release"], "is_try_builder": True, }, }) self.command.rietveld = Rietveld(web) layout_test_results = LayoutTestResults({ 'tests': { 'fast': { 'dom': { 'prototype-inheritance.html': { 'expected': 'PASS', 'actual': 'TEXT', 'is_unexpected': True, }, 'prototype-banana.html': { 'expected': 'FAIL', 'actual': 'PASS', 'is_unexpected': True, }, 'prototype-taco.html': { 'expected': 'PASS', 'actual': 'PASS TEXT', 'is_unexpected': True, }, 'prototype-chocolate.html': { 'expected': 'FAIL', 'actual': 'IMAGE+TEXT' }, 'prototype-crashy.html': { 'expected': 'PASS', 'actual': 'CRASH', 'is_unexpected': True, }, 'prototype-newtest.html': { 'expected': 'PASS', 'actual': 'MISSING', 'is_unexpected': True, 'is_missing_text': True, } } }, 'svg': { 'dynamic-updates': { 'SVGFEDropShadowElement-dom-stdDeviation-attr.html': { 'expected': 'PASS', 'actual': 'IMAGE', 'has_stderr': True, 'is_unexpected': True, } } } } }) for build in [Build('MOCK Try Win', 5000), Build('MOCK Try Mac', 4000)]: self.tool.buildbot.set_results(build, layout_test_results) self.tool.buildbot.set_retry_sumary_json(Build('MOCK Try Win', 5000), json.dumps({ 'failures': [ 'fast/dom/prototype-newtest.html', 'fast/dom/prototype-taco.html', 'fast/dom/prototype-inheritance.html', 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html', ], 'ignored': [], })) # Write to the mock filesystem so that these tests are considered to exist. port = self.mac_port tests = [ 'fast/dom/prototype-taco.html', 'fast/dom/prototype-inheritance.html', 'fast/dom/prototype-newtest.html', 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html', ] for test in tests: self._write(port.host.filesystem.join(port.layout_tests_dir(), test), 'contents')