Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Issue 2875203005: Refactor and clean up the status file parsing code. (Closed)

Created:
3 years, 7 months ago by Bob Nystrom
Modified:
3 years, 7 months ago
Reviewers:
Bill Hesse, kevmoo
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refactor and clean up the status file parsing code. - Make the parser less error tolerant. The expression parser used to ignore any unrecognized tokens, which means a status like "RuntimeError CompileError" (not the missing comma) was parsed as simply "RuntimeError", which seems bad. Now it reports an error. Fixed a couple of status files that thought they were setting statuses that they weren't (!). - Separate out parsing a status file from applying the environment to determine which sections are active. This makes it possible to, for example, generate expectation sets for multiple environments without having to reparse each time. - Simplify expression parsing. Remove set expressions since they weren't used for anything useful. A test's expectations are a simple comma-separated list and don't need anything beyond that. Merge Scanner and Tokenizer since the latter was a glorified function. - Make more names private so that it's clearer what's used outside of various libraries. - Generally modernize the style. - Add *lots* of documentation. Again, there should be no behavioral changes. I ran: ./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib Before and after the change and verified that the output was the same (aside from timing). BUG= R=whesse@google.com Committed: https://github.com/dart-lang/sdk/commit/0b7728da1bef08c1c1e092005d9fd8c8bff5fa6c

Patch Set 1 #

Total comments: 11

Patch Set 2 : Dartfmt. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+806 lines, -756 lines) Patch
M tests/co19/co19-dart2js.status View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/language/language.status View 1 1 chunk +1 line, -1 line 0 comments Download
A tools/testing/dart/expectation.dart View 1 1 chunk +211 lines, -0 lines 0 comments Download
A tools/testing/dart/expectation_set.dart View 1 chunk +118 lines, -0 lines 0 comments Download
M tools/testing/dart/runtime_configuration.dart View 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/dart/status_expression.dart View 1 1 chunk +167 lines, -248 lines 0 comments Download
A tools/testing/dart/status_file.dart View 1 chunk +164 lines, -0 lines 0 comments Download
D tools/testing/dart/status_file_parser.dart View 1 chunk +0 lines, -368 lines 0 comments Download
M tools/testing/dart/summary_report.dart View 2 chunks +9 lines, -10 lines 0 comments Download
M tools/testing/dart/test_progress.dart View 1 4 chunks +4 lines, -4 lines 0 comments Download
M tools/testing/dart/test_runner.dart View 1 27 chunks +98 lines, -96 lines 0 comments Download
M tools/testing/dart/test_suite.dart View 1 12 chunks +32 lines, -27 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
Bob Nystrom
This was therapeutic. Also, now I understand what the various expectations mean. And the status ...
3 years, 7 months ago (2017-05-12 23:13:15 UTC) #2
Bill Hesse
lgtm https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/expectation.dart File tools/testing/dart/expectation.dart (right): https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/expectation.dart#newcode125 tools/testing/dart/expectation.dart:125: // TODO(rnystrom): Why not use timeout for these? ...
3 years, 7 months ago (2017-05-15 16:15:09 UTC) #3
kevmoo
DB C/Q https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_expression.dart File tools/testing/dart/status_expression.dart (right): https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_expression.dart#newcode6 tools/testing/dart/status_expression.dart:6: abstract class Expression { Possible? https://github.com/dart-lang/boolean_selector
3 years, 7 months ago (2017-05-15 21:06:48 UTC) #5
Bob Nystrom
Committed patchset #2 (id:20001) manually as 0b7728da1bef08c1c1e092005d9fd8c8bff5fa6c (presubmit successful).
3 years, 7 months ago (2017-05-15 22:42:23 UTC) #7
Bob Nystrom
3 years, 7 months ago (2017-05-15 22:42:51 UTC) #8
Message was sent while issue was closed.
Thanks for the review!

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/expectat...
File tools/testing/dart/expectation.dart (right):

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/expectat...
tools/testing/dart/expectation.dart:125: // TODO(rnystrom): Why not use timeout
for these?
On 2017/05/15 16:15:08, Bill Hesse wrote:
> Because they then use a process for the amount of time it takes to timeout,
and
> increase the running time of the test suite.  We should not have many (or any)
> tests marked Timeout, they should be SkipSlow instead.

Good to know! Updated the comment.

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/expectat...
tools/testing/dart/expectation.dart:144: // not appear to be understood by
test.dart.
On 2017/05/15 16:15:08, Bill Hesse wrote:
> I don't know.  Please find the author who added it to the status files, and
> assign to them.

Looks like a pkg/front_end/lib/src/fasta/testing thing. Added a comment.

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_e...
File tools/testing/dart/status_expression.dart (right):

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_e...
tools/testing/dart/status_expression.dart:6: abstract class Expression {
On 2017/05/15 21:06:48, kevmoo wrote:
> Possible? https://github.com/dart-lang/boolean_selector

For test.dart, we try not to rely on any external dependencies since this is so
fundamental to the infrastructure. Also, switching this out might subtly change
the grammar in ways we don't expect.

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_e...
tools/testing/dart/status_expression.dart:188: new
RegExp(r"^([()$\w\s,]|(\&\&)|(\|\|)|(\=\=)|(\!\=))+$");
On 2017/05/15 16:15:08, Bill Hesse wrote:
> I think you can remove ',' from the two regexps, if we aren't handling input
> with ',' in it.

Nice catch! Done.

https://codereview.chromium.org/2875203005/diff/1/tools/testing/dart/status_e...
tools/testing/dart/status_expression.dart:209: .allMatches(expression)
On 2017/05/15 16:15:09, Bill Hesse wrote:
> I had no idea that this was non-overlapping.  You learn something every day.

Guess so. I did too! (This was in the original code as well, it just moved down
here.)

Powered by Google App Engine
This is Rietveld 408576698