Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 2467013002: Disallow [ Missing ] expectations in test expectations files. (Closed)
Patch Set: Change current missing expectations to skips Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 if 'NeverFixTests' in filename and expectations != ['WONTFIX', 'SKIP']: 429 if 'NeverFixTests' in filename and expectations != ['WONTFIX', 'SKIP']:
430 warnings.append('Only WONTFIX expectations are allowed in NeverFixTe sts') 430 warnings.append('Only WONTFIX expectations are allowed in NeverFixTe sts')
431 431
432 if 'SlowTests' in filename and expectations != ['SLOW']: 432 if 'SlowTests' in filename and expectations != ['SLOW']:
433 warnings.append('Only SLOW expectations are allowed in SlowTests') 433 warnings.append('Only SLOW expectations are allowed in SlowTests')
434 434
435 if not expectations and not has_unrecognized_expectation: 435 if not expectations and not has_unrecognized_expectation:
436 warnings.append('Missing expectations.') 436 warnings.append('Missing expectations.')
437 437
438 if 'MISSING' in expectations:
439 warnings.append(
440 '"Missing" expectations are not allowed; either download new bas elines '
441 '(see https://goo.gl/SHVYrZ) or use "NeedsRebaseline" expecatati ons.')
442
438 expectation_line.bugs = bugs 443 expectation_line.bugs = bugs
439 expectation_line.specifiers = specifiers 444 expectation_line.specifiers = specifiers
440 expectation_line.expectations = expectations 445 expectation_line.expectations = expectations
441 expectation_line.name = name 446 expectation_line.name = name
442 expectation_line.warnings = warnings 447 expectation_line.warnings = warnings
443 return expectation_line 448 return expectation_line
444 449
445 @staticmethod 450 @staticmethod
446 def create_passing_expectation(test): 451 def create_passing_expectation(test):
447 expectation_line = TestExpectationLine() 452 expectation_line = TestExpectationLine()
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 # If reconstitute_only_these is an empty list, we want to return ori ginal_string. 1202 # If reconstitute_only_these is an empty list, we want to return ori ginal_string.
1198 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey. 1203 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey.
1199 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these: 1204 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these:
1200 return expectation_line.to_string(test_configuration_converter) 1205 return expectation_line.to_string(test_configuration_converter)
1201 return expectation_line.original_string 1206 return expectation_line.original_string
1202 1207
1203 def nones_out(expectation_line): 1208 def nones_out(expectation_line):
1204 return expectation_line is not None 1209 return expectation_line is not None
1205 1210
1206 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 1211 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698