Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29616611: Issue 6090 - Allow use of console to be seen during tests (Closed)

Created:
Nov. 23, 2017, 7:19 p.m. by hub
Modified:
Nov. 28, 2017, 3:29 p.m.
Reviewers:
sergei, Wladimir Palant
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

Issue 6090 - Allow use of console to be seen during tests

Patch Set 1 #

Total comments: 12

Patch Set 2 : Added missing patch. Review feedback #

Total comments: 2

Patch Set 3 : review feedback #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -4 lines) Patch
M test/_common.js View 1 2 2 chunks +21 lines, -2 lines 4 comments Download
M test/filterStorage.js View 1 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 12
hub
Nov. 23, 2017, 7:19 p.m. (2017-11-23 19:19:51 UTC) #1
hub
this patch allow: 1. to have console output from compiled code to be displayed. This ...
Nov. 23, 2017, 7:24 p.m. (2017-11-23 19:24:00 UTC) #2
sergei
IMO it's a serious question which requires some background information, therefore I have created the ...
Nov. 24, 2017, 10:15 a.m. (2017-11-24 10:15:29 UTC) #3
sergei
https://codereview.adblockplus.org/29616611/diff/29616612/test/_common.js File test/_common.js (right): https://codereview.adblockplus.org/29616611/diff/29616612/test/_common.js#newcode422 test/_common.js:422: exports.maybeExpectError = function(msg, test) On 2017/11/24 10:15:28, sergei wrote: ...
Nov. 24, 2017, 1:49 p.m. (2017-11-24 13:49:13 UTC) #4
hub
https://codereview.adblockplus.org/29616611/diff/29616612/test/_common.js File test/_common.js (right): https://codereview.adblockplus.org/29616611/diff/29616612/test/_common.js#newcode422 test/_common.js:422: exports.maybeExpectError = function(msg, test) On 2017/11/24 13:49:13, sergei wrote: ...
Nov. 24, 2017, 3:48 p.m. (2017-11-24 15:48:59 UTC) #5
sergei
LGTM
Nov. 24, 2017, 4:46 p.m. (2017-11-24 16:46:20 UTC) #6
sergei
https://codereview.adblockplus.org/29616611/diff/29617571/test/_common.js File test/_common.js (right): https://codereview.adblockplus.org/29616611/diff/29617571/test/_common.js#newcode434 test/_common.js:434: result = test(); There is no necessity in an ...
Nov. 24, 2017, 4:46 p.m. (2017-11-24 16:46:28 UTC) #7
hub
https://codereview.adblockplus.org/29616611/diff/29617571/test/_common.js File test/_common.js (right): https://codereview.adblockplus.org/29616611/diff/29617571/test/_common.js#newcode434 test/_common.js:434: result = test(); On 2017/11/24 16:46:27, sergei wrote: > ...
Nov. 24, 2017, 6:17 p.m. (2017-11-24 18:17:56 UTC) #8
sergei
LGTM, however test/signatures.js also prints some messages but it uses console.warn. Since it's not exactly ...
Nov. 24, 2017, 7:40 p.m. (2017-11-24 19:40:23 UTC) #9
hub
but without https://codereview.adblockplus.org/29616589/ the output is gonna be very verbose.
Nov. 24, 2017, 8:28 p.m. (2017-11-24 20:28:26 UTC) #10
Wladimir Palant
https://codereview.adblockplus.org/29616611/diff/29617577/test/_common.js File test/_common.js (right): https://codereview.adblockplus.org/29616611/diff/29617577/test/_common.js#newcode97 test/_common.js:97: }, Just remove console here, not overriding this global ...
Nov. 28, 2017, 12:59 p.m. (2017-11-28 12:59:40 UTC) #11
hub
Nov. 28, 2017, 3:29 p.m. (2017-11-28 15:29:34 UTC) #12
Message was sent while issue was closed.
Follow up patch at https://codereview.adblockplus.org/29622595/

https://codereview.adblockplus.org/29616611/diff/29617577/test/_common.js
File test/_common.js (right):

https://codereview.adblockplus.org/29616611/diff/29617577/test/_common.js#new...
test/_common.js:97: },
On 2017/11/28 12:59:39, Wladimir Palant wrote:
> Just remove console here, not overriding this global will do.

Done in follow up patch

https://codereview.adblockplus.org/29616611/diff/29617577/test/_common.js#new...
test/_common.js:424: let msgMatch = new RegExp(`^Error: ${msg}[\r\n]`);
On 2017/11/28 12:59:40, Wladimir Palant wrote:
> 1) Inserting unescaped strings into a regular expression is a footgun
(consider
> dots or question marks). If anything, the regular expression should be used to
> extract the message, then you should use regular string comparison.

Done in followup patch.

> 2) Parsing string representation of errors isn't a good idea either, it can
> change. You have an Error object here, just look at the `error.message`
> property.

we only have a string at that level. We'd need to change the error reporting.
Since this is only in the test, I consider it to be a reasonable assumption.

Powered by Google App Engine
This is Rietveld