Chromium Code Reviews| Index: appengine/findit/waterfall/test/extractors_test.py |
| diff --git a/appengine/findit/waterfall/test/extractors_test.py b/appengine/findit/waterfall/test/extractors_test.py |
| index 15a62f90240b1acc54061a6cb483375295c05946..45448cf24cc935c3440d1b4a0e29547f57884d4f 100644 |
| --- a/appengine/findit/waterfall/test/extractors_test.py |
| +++ b/appengine/findit/waterfall/test/extractors_test.py |
| @@ -6,6 +6,7 @@ import textwrap |
| from testing_utils import testing |
| from waterfall import extractors |
| +from waterfall import waterfall_config |
| from waterfall.extractor import Extractor |
| @@ -508,6 +509,81 @@ Note:You can safely ignore the above warning unless this call should not happen. |
| failure_log, extractors.CompileStepExtractor, expected_signal_json, |
| 'iOS_Simulator_(dbg)', 'chromium.mac') |
| + def testCompileStepStrictRegexForCompileFailures(self): |
| + def Mocked_EnableStrictRegexForCompileLinkFailures(*_): |
| + return True |
| + self.mock(waterfall_config, 'EnableStrictRegexForCompileLinkFailures', |
| + Mocked_EnableStrictRegexForCompileLinkFailures) |
| + |
| + goma_clang_prefix = ( |
| + '/b/build/goma/gomacc ' |
| + '../../third_party/llvm-build/Release+Asserts/bin/clang++ ' |
| + '-MMD -MF') |
| + failure_log = textwrap.dedent(""" |
| + [1832/2467 | 117.498] CXX obj/a/b/test.file.o |
| + blabla... |
| + FAILED: %s obj/a.o.d ... -c a.c -o obj/a.o |
| + blalba... |
| + FAILED: %s obj/b.o.d ... -c a.c -o obj/c.o |
| + blalba... |
| + FAILED with 1: %s obj/f.o.d -c f.c -o obj/f.o |
| + ninja: build stopped: subcommand failed. |
| + |
| + /b/build/goma/goma_ctl.sh stat |
| + blabla...""" % ( |
| + goma_clang_prefix, goma_clang_prefix, goma_clang_prefix)) |
| + expected_signal_json = { |
| + 'files': { |
| + 'obj/f.o': [], |
| + 'f.c': [], |
| + }, |
| + 'keywords': {}, |
| + 'failed_targets': [ |
| + { |
| + 'source': 'a.c', |
| + 'target': 'obj/a.o', |
| + }, |
| + ] |
| + } |
| + |
| + self._RunTest( |
| + failure_log, extractors.CompileStepExtractor, expected_signal_json) |
| + |
| + |
| + def testCompileStepStrictRegexForLinkFailures(self): |
| + def Mocked_EnableStrictRegexForCompileLinkFailures(*_): |
| + return True |
| + self.mock(waterfall_config, 'EnableStrictRegexForCompileLinkFailures', |
| + Mocked_EnableStrictRegexForCompileLinkFailures) |
|
chanli
2016/03/15 06:07:49
nit: we can reuse this mock from testCompileStepS
stgao
2016/03/15 18:32:21
Done.
|
| + |
| + goma_clang_prefix = ( |
| + '/b/build/goma/gomacc ' |
| + '../../third_party/llvm-build/Release+Asserts/bin/clang++') |
| + failure_log = textwrap.dedent(""" |
| + [1832/2467 | 117.498] CXX obj/a/b/test.file.o |
| + blabla... |
| + FAILED: %s -Wl,-z,now ... -o exe -Wl,--start-group obj/a.o ... |
| + blalba... |
| + FAILED: cd a/b/c; python script.py a b c blabla.... |
| + blalba... |
| + ninja: build stopped: subcommand failed. |
| + |
| + /b/build/goma/goma_ctl.sh stat |
| + blabla...""" % goma_clang_prefix) |
| + expected_signal_json = { |
| + 'files': { |
| + }, |
| + 'keywords': {}, |
| + 'failed_targets': [ |
| + { |
| + 'target': 'exe', |
| + }, |
| + ] |
| + } |
| + |
| + self._RunTest( |
| + failure_log, extractors.CompileStepExtractor, expected_signal_json) |
| + |
| def testCheckPermExtractor(self): |
| failure_log = textwrap.dedent(""" |
| a/b/c.py |