Bug 77744

Summary: check-webkit-style is throwing an exception
Product: WebKit Reporter: Philip Rogers <pdr>
Component: Tools / TestsAssignee: Ojan Vafai <ojan>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dpranke, eric, levin, ojan, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Philip Rogers 2012-02-03 09:20:47 PST
On a clean checkout, make a minor change to any test_expectation file and then run check-webkit-style. You'll get the following error:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1

Traceback (most recent call last):
  File "Tools/Scripts/check-webkit-style", line 48, in <module>
    sys.exit(CheckWebKitStyle().main())
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/main.py", line 154, in main
    patch_checker.check(patch)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/patchreader.py", line 66, in check
    self._text_file_reader.process_file(file_path=path, line_numbers=line_numbers)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/filereader.py", line 130, in process_file
    self._processor.process(lines, file_path, **kwargs)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/checker.py", line 826, in process
    checker.check(lines)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/checkers/test_expectations.py", line 117, in check
    overrides=overrides)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/style/checkers/test_expectations.py", line 96, in check_test_expectations
    is_lint_mode=True, overrides=overrides)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py", line 721, in __init__
    self._add_skipped_tests(port.skipped_tests(tests))
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/layout_tests/port/webkit.py", line 376, in skipped_tests
    return self.skipped_layout_tests(test_list)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/layout_tests/port/webkit.py", line 372, in skipped_layout_tests
    tests_to_skip.update(self._skipped_tests_for_unsupported_features(test_list))
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/layout_tests/port/webkit.py", line 319, in _skipped_tests_for_unsupported_features
    if self._has_test_in_directories(self._missing_feature_to_skipped_tests().values(), test_list):
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/layout_tests/port/webkit.py", line 311, in _has_test_in_directories
    for directory, test in itertools.product(directories, test_list):
TypeError: 'NoneType' object is not iterable

This same output can be seen on various bugs, for instance:
https://bugs.webkit.org/show_bug.cgi?id=77067
https://bugs.webkit.org/show_bug.cgi?id=77245
Comment 1 Eric Seidel (no email) 2012-02-03 12:26:12 PST
Sounds like this is a regression from yesterday?
Comment 2 Eric Seidel (no email) 2012-02-03 12:26:45 PST
Likely from Ojan's changes to speed up NRWT.
Comment 3 Ojan Vafai 2012-02-03 15:43:55 PST
Created attachment 125437 [details]
Patch
Comment 4 David Levin 2012-02-03 15:47:43 PST
Comment on attachment 125437 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=125437&action=review

> Tools/Scripts/webkitpy/layout_tests/port/webkit.py:313
>          directories = itertools.chain.from_iterable(directory_lists)

Would it make sense to make itertools.product return [] in this case, so every place that uses it just works when "not test_list"?
Comment 5 Ojan Vafai 2012-02-03 15:59:19 PST
(In reply to comment #4)
> (From update of attachment 125437 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=125437&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/port/webkit.py:313
> >          directories = itertools.chain.from_iterable(directory_lists)
> 
> Would it make sense to make itertools.product return [] in this case, so every place that uses it just works when "not test_list"?

It might, but it's a python library, so... :)
Comment 6 WebKit Review Bot 2012-02-04 01:51:04 PST
Comment on attachment 125437 [details]
Patch

Clearing flags on attachment: 125437

Committed r106735: <http://trac.webkit.org/changeset/106735>
Comment 7 WebKit Review Bot 2012-02-04 01:51:10 PST
All reviewed patches have been landed.  Closing bug.