Bug 96149 - Handle non-existant TestExpectations files gracefully
Summary: Handle non-existant TestExpectations files gracefully
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: Ojan Vafai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-07 14:17 PDT by Ojan Vafai
Modified: 2012-09-10 16:10 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.84 KB, patch)
2012-09-07 14:18 PDT, Ojan Vafai
eric: review+
eric: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ojan Vafai 2012-09-07 14:17:42 PDT
Handle non-existant TestExpectations files gracefully
Comment 1 Ojan Vafai 2012-09-07 14:18:54 PDT
Created attachment 162868 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-09-07 14:30:55 PDT
I'm not sure what this is for?
Comment 3 Ojan Vafai 2012-09-07 14:35:04 PDT
Right now, running "run-webkit-tests --lint-test-files" throws a stack halfway through because LayoutTests/platform/win-7sp0/TestExpectations doesn't exist. I'd rather make this code change than create a dummy file, especially as we don't use nrwt on Apple Windows still, e.g. see LayoutTests/platform/win/TestExpectations, which has a comment at the top saying the file is unused, but people still add lines to it.
Comment 4 Ojan Vafai 2012-09-07 14:36:51 PDT
I suppose the plan is to get rid of Skipped files and just have TestExpectations in the end, but I still don't think we need to require one such file for each subdirectory.
Comment 5 Eric Seidel (no email) 2012-09-07 14:41:03 PDT
Comment on attachment 162868 [details]
Patch

OK.
Comment 6 Ojan Vafai 2012-09-07 15:06:07 PDT
Committed r127925: <http://trac.webkit.org/changeset/127925>
Comment 7 Dirk Pranke 2012-09-10 15:04:29 PDT
I'm not a huge fan of this solution; it seems like an error to me to say that you are using a TestExpectations file and then not have it actually exist. I think we should either modify expectatation_files() to not return files that don't exist, or just create a stub file (like I've done on the other ports); the latter seems preferable.
Comment 8 Tony Chang 2012-09-10 15:10:11 PDT
(In reply to comment #7)
> I'm not a huge fan of this solution; it seems like an error to me to say that you are using a TestExpectations file and then not have it actually exist. I think we should either modify expectatation_files() to not return files that don't exist, or just create a stub file (like I've done on the other ports); the latter seems preferable.

FWIW, I suggested this because the stub file doesn't prevent people from adding lines.  See http://trac.webkit.org/changeset/127927#file7 .

In practice, you would only accidentally not have a TestExpectations file when creating a new port. I think you would end up needing to create the file immediately, so I'm not sure there's any fear about someone forgetting to create TestExpectations.
Comment 9 Dirk Pranke 2012-09-10 15:24:00 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > I'm not a huge fan of this solution; it seems like an error to me to say that you are using a TestExpectations file and then not have it actually exist. I think we should either modify expectatation_files() to not return files that don't exist, or just create a stub file (like I've done on the other ports); the latter seems preferable.
> 
> FWIW, I suggested this because the stub file doesn't prevent people from adding lines.  See http://trac.webkit.org/changeset/127927#file7 .
> 

This is true. I'm not sure that this is a huge problem in practice, but then, I'm not sure how big an issue missing files are either (assuming code returning the list of files that are actually expected to exist). To me, the biggest problem is that this patch seems like a hack - one routine is returning something it shouldn't and we're working around it. We should fix the real problem.

> In practice, you would only accidentally not have a TestExpectations file when creating a new port. I think you would end up needing to create the file immediately, so I'm not sure there's any fear about someone forgetting to create TestExpectations.

I'm not sure what you're getting at here? Are you agreeing with me that missing files should be treated as errors, or saying something else?
Comment 10 Tony Chang 2012-09-10 16:10:35 PDT
(In reply to comment #9)
> I'm not sure what you're getting at here? Are you agreeing with me that missing files should be treated as errors, or saying something else?

I'm saying that missing files should not be treated as errors.  Modifying expectatation_files() to not return files that don't exist is also fine with me.