WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
194283
webkit-patch print-expectations fails to format TestExpectationLine with DumpJSConsoleLogInStdErr
https://bugs.webkit.org/show_bug.cgi?id=194283
Summary
webkit-patch print-expectations fails to format TestExpectationLine with Dump...
Fujii Hironori
Reported
2019-02-05 00:10:37 PST
webkit-patch print-expectations fails to format TestExpectationLine with DumpJSConsoleLogInStdErr
> $ ./Tools/Scripts/webkit-patch print-expectations --port=wincairo imported/w3c/web-platform-tests/fetch/ > --lint-test-files warnings: > LayoutTests/platform/gtk/TestExpectations:3782 Path does not exist. imported/w3c/web-platform-tests/web-animations/timing-model/animations/current-time.html > > Traceback (most recent call last): > File "./Tools/Scripts/webkit-patch", line 84, in <module> > main() > File "./Tools/Scripts/webkit-patch", line 79, in main > WebKitPatch(os.path.abspath(__file__)).main() > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 305, in main > result = command.check_arguments_and_execute(options, args, self) > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 123, in check_arguments_and_execute > return self.execute(options, args, tool) or 0 > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/tool/commands/queries.py", line 501, in execute > print('\n'.join(self._format_lines(options, port_name, lines))) > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/tool/commands/queries.py", line 525, in _format_lines > output.append("%s" % line.to_string(None, include_modifiers, include_expectations, include_comment=False)) > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py", line 460, in to_string > include_modifiers, include_expectations, include_comment) > File "/mnt/c/webkit/ga/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py", line 510, in _format_line > result += ' [ %s ]' % ' '.join(sorted(set(new_expectations))) > TypeError: sequence item 0: expected string, NoneType found
Attachments
Patch
(3.07 KB, patch)
2019-02-05 01:06 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(3.00 KB, patch)
2019-02-13 00:32 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(3.02 KB, patch)
2019-12-10 18:07 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2019-02-05 01:06:12 PST
Created
attachment 361173
[details]
Patch
Alexey Proskuryakov
Comment 2
2019-02-05 10:44:06 PST
Comment on
attachment 361173
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=361173&action=review
> Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py:244 > + 'DumpJSConsoleLogInStdErr': 'DUMPJSCONSOLELOGINSTDERR',
Would we need changes in the flakiness dashboard to support this value? I think that we are hitting a design mistake with regards to DumpJSConsoleLogInStdErr - it is not an expectation, so mixing it with expectations causes trouble.
Jonathan Bedard
Comment 3
2019-02-05 13:08:49 PST
This bug very much confuses me. Why would we have a test expectation with DumpJSConsoleLogInStdErr in it? That feels like an abuse of the TestExpectations.
youenn fablet
Comment 4
2019-02-05 19:21:13 PST
> Would we need changes in the flakiness dashboard to support this value?
No
> I think that we are hitting a design mistake with regards to > DumpJSConsoleLogInStdErr - it is not an expectation, so mixing it with > expectations causes trouble.
It is not really a test expectation, it is closer to 'Slow' in the sense it is changing the way the test is run. It was put there and not in some other file for convenience following the 'one place is better than two'.
Fujii Hironori
Comment 5
2019-02-06 19:33:07 PST
DumpJSConsoleLogInStdErr has been introduced in
Bug 161310
. webkit-test-runner magic comments or window.testRunner or window.internals can be the alternatives. Some imported tests have been modifed to have a webkit-test-runner magic comment. E.g.
https://trac.webkit.org/browser/webkit/trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html?rev=241112#L1
internals.setConsoleMessageListener() doesn't prevent console log. Settings::logsPageMessagesToSystemConsoleEnabled doesn't prevent console log.
youenn fablet
Comment 6
2019-02-06 19:55:43 PST
(In reply to Fujii Hironori from
comment #5
)
> DumpJSConsoleLogInStdErr has been introduced in
Bug 161310
. > > webkit-test-runner magic comments or window.testRunner or window.internals > can be the alternatives.
DumpJSConsoleLogInStdErr is mostly useful for imported tests that we do not want to modify. For tests that we can modify, there are usually ways, though not always, to not rely on it.
> Some imported tests have been modifed to have a webkit-test-runner magic > comment. > E.g. >
https://trac.webkit.org/browser/webkit/trunk/LayoutTests/imported/w3c/web
- > platform-tests/css/css-logical/logical-box-border-color.html?rev=241112#L1
When reimporting these files, these comments will be lost by the importer and one will need to add them again. I hope these changes are expected to be temporary until we can activate the feature globally. The test importer could try to preserve these comments. In some cases, this is not possible though. Tests like like imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.any.html are templates generated by the WPT server. The only way would be to modify the WPT server and we would certainly not be able to upstream these changes. An alternative is to apply DumpJSConsoleLogInStdErr to all WPT tests but we decided not to do that as it sometimes catches regressions. Another alternative would be to have some ways to grab the test options outside of the test content itself, either a central file or a file close to each test. I don't think we reached consensus there.
Fujii Hironori
Comment 7
2019-02-07 00:23:14 PST
(In reply to youenn fablet from
comment #6
)
> Another alternative would be to have some ways to grab the test options > outside of the test content itself, either a central file or a file close to > each test. I don't think we reached consensus there.
This seems the best. How about the idea reusing tests-options.json for such purpose?
https://trac.webkit.org/browser/webkit/trunk/LayoutTests/tests-options.json?rev=241112
tests-options.json has been introduced in
Bug 161601
.
Fujii Hironori
Comment 8
2019-02-07 00:26:01 PST
I realize a tiny problem of DumpJSConsoleLogInStdErr that it outputs into stderr even though it is not a error message. Windows port has "EDITING DELEGATE:" filter in do_text_results_differ.
https://trac.webkit.org/browser/webkit/trunk/Tools/Scripts/webkitpy/port/win.py?rev=241112#L108
We can have "CONSOLE:" filter for the purpose without modifying DRT and WTR. This approach wouldn't pollute the content of -stderr.txt.
Fujii Hironori
Comment 9
2019-02-07 02:20:44 PST
(In reply to Fujii Hironori from
comment #7
)
> How about the idea reusing tests-options.json for such purpose?
This is not easy because magic comments are retrieved by DRT and WTR, not by webkit-test-runner. DRT and WTR need to be changed to parse tests-options.json. It is easier to use a option file for each test, which is placed close to the test.
Fujii Hironori
Comment 10
2019-02-07 06:07:14 PST
(In reply to Fujii Hironori from
comment #8
)
> I realize a tiny problem of DumpJSConsoleLogInStdErr that it outputs into > stderr even though it is not a error message.
Darin mentioned this in
Bug 161310 Comment 15
. I didn't read the lengthy discussion. I should have read it first.
Fujii Hironori
Comment 11
2019-02-12 23:29:17 PST
Bug 177027
has introduced dumpJSConsoleLogInStdErr test option.
> webkit-test-runner [ dumpJSConsoleLogInStdErr=true ]
I think we should use this for non-imported tests instead of using DumpJSConsoleLogInStdErr expectation in TestExpectations.
Fujii Hironori
Comment 12
2019-02-13 00:32:30 PST
Created
attachment 361901
[details]
Patch
Fujii Hironori
Comment 13
2019-02-13 00:56:53 PST
Comment on
attachment 361901
[details]
Patch Oops, wrong patch.
Fujii Hironori
Comment 14
2019-02-13 02:39:29 PST
(In reply to Fujii Hironori from
comment #11
)
> I think we should use this for non-imported tests instead of using > DumpJSConsoleLogInStdErr expectation in TestExpectations.
Filed
Bug 194586
.
youenn fablet
Comment 15
2019-02-14 08:52:38 PST
> Tests like like imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.any.html are templates generated by the WPT server.
If we decide to continue with these templated .any.html, we could actually modify them to include <!-- webkit-test-runner --> comments, as I guess the test runner is reading the file and not the HTTP resource. We would then need to instruct the importer to preserve any of these comments.
Fujii Hironori
Comment 16
2019-02-15 01:40:38 PST
a previous discussion: [webkit-dev] WPT tests and runtime-enabled features
https://lists.webkit.org/pipermail/webkit-dev/2017-June/029165.html
Fujii Hironori
Comment 17
2019-02-17 22:27:54 PST
(In reply to youenn fablet from
comment #15
)
> > Tests like like imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.any.html are templates generated by the WPT server. > > If we decide to continue with these templated .any.html, we could actually > modify them to include <!-- webkit-test-runner --> comments, as I guess the > test runner is reading the file and not the HTTP resource. > We would then need to instruct the importer to preserve any of these > comments.
youenn, do you prefer this approach? I think it is easier to use a option file for each test, which is placed close to the test, as you mentionsed in
comment 6
. E.g. imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.any-option.txt
Fujii Hironori
Comment 18
2019-12-10 18:03:05 PST
As Youenn mentioned in
Bug 204793 Comment 5
, there is no consensus on removing all DumpJSConsoleLogInStdErr expectation at the moment yet. I'm going to fix the original issue of formatting DumpJSConsoleLogInStdErr (
comment 0
).
Fujii Hironori
Comment 19
2019-12-10 18:07:46 PST
Created
attachment 385333
[details]
Patch
Fujii Hironori
Comment 20
2019-12-11 17:56:35 PST
Youenn, can I ask you review?
Fujii Hironori
Comment 21
2019-12-12 00:57:24 PST
Thank you! I will land it unless anyone objects.
Fujii Hironori
Comment 22
2019-12-12 17:51:39 PST
Comment on
attachment 385333
[details]
Patch Clearing flags on attachment: 385333 Committed
r253459
: <
https://trac.webkit.org/changeset/253459
>
Fujii Hironori
Comment 23
2019-12-12 17:51:43 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 24
2019-12-12 17:52:30 PST
<
rdar://problem/57898667
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug