Bug 80083 - nrwt: virtual tests aren't being run
Summary: nrwt: virtual tests aren't being run
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dirk Pranke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-01 19:19 PST by Dirk Pranke
Modified: 2012-03-01 19:28 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.69 KB, patch)
2012-03-01 19:19 PST, Dirk Pranke
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Pranke 2012-03-01 19:19:12 PST
nrwt: virtual tests aren't being run
Comment 1 Dirk Pranke 2012-03-01 19:19:45 PST
Created attachment 129792 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-01 19:22:26 PST
Comment on attachment 129792 [details]
Patch

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

> Tools/Scripts/webkitpy/layout_tests/port/base.py:1086
> +                for test in suite.tests:
> +                    if any(test.startswith(p) for p in paths):
> +                        virtual_tests.add(test)
> +            else:
> +                virtual_tests.update(set(suite.tests.keys()))

I suspect this whole block could be written shorter with comprehesions or a filter statement.
Comment 3 Dirk Pranke 2012-03-01 19:25:53 PST
(In reply to comment #2)
> (From update of attachment 129792 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=129792&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/port/base.py:1086
> > +                for test in suite.tests:
> > +                    if any(test.startswith(p) for p in paths):
> > +                        virtual_tests.add(test)
> > +            else:
> > +                virtual_tests.update(set(suite.tests.keys()))
> 
> I suspect this whole block could be written shorter with comprehesions or a filter statement.

Shorter, probably. I don't know if it would be more comprehensible, though. It's a nested-loop join (meaning for each item in one list we have to iterate over another list), and I find those are usually hard to follow w/ list comprehensions.

I don't think there's an eas(ier?) way to do it with filter(), but I could be wrong. This code at least has the virtue of being pretty easy to follow. We could pull the 'if paths' out of the outer loop, and it might be slightly easier to follow as well.
Comment 4 Dirk Pranke 2012-03-01 19:28:35 PST
Committed r109490: <http://trac.webkit.org/changeset/109490>