mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
188c1501be
There's no option to output the results of the test262 harness in silent mode so
every pass and failure outputs multiple lines to stdout. Since there are many
thousands of tests this results in unusable log files that are over 200k lines
long. This PR redirects stdout to a tmp file and then we reformat the result
into a small JSON object, grouped by the failure message with count.
Example:
```json [ { "pass": false, "data": { "message": "Expected no
error, got Error: TODO: Support complex object assignment", "count": 66
} }, { "pass": false, "data": { "message": "Expected no
error, got Error: TODO: lowerExpression(FunctionExpression)", "count": 4
} }, { "pass": false, "data": { "message": "Expected no
error, got Error: TODO: lowerExpression(UnaryExpression)", "count": 6
} }, { "pass": false, "data": { "message": "Expected no error,
got Error: todo: lower initializer in ForStatement", "count": 28 }
}, { "pass": false, "data": { "message": "Expected no error, got
Invariant Violation: Expected value for identifier `15` to be initialized.",
"count": 14 } }, { "pass": false, "data": { "message":
"Expected no error, got Invariant Violation: `var` declarations are not
supported, use let or const", "count": 76 } }, { "pass": true,
"data": { "message": null, "count": 1 } } ] ```
13 lines
427 B
Bash
Executable File
13 lines
427 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
TMPFILE=$(mktemp /tmp/forget-test262-XXXXX)
|
|
|
|
yarn run --silent test262-harness \
|
|
--threads=10 \
|
|
--preprocessor=scripts/test262-preprocessor.js \
|
|
--reporter=json \
|
|
--reporter-keys=file,result \
|
|
'test262/test/**/*.js' >> $TMPFILE
|
|
|
|
jq '. | group_by(.result.pass,.result.message) | map({"pass": .[0].result.pass, "message": .[0].result.message, "count": length}) | tostring' $TMPFILE |