-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support JSON line output. #8242
Conversation
@@ -32,7 +34,10 @@ function summarize(coverageMap: CoverageMap): CoverageMap { | |||
} | |||
} | |||
|
|||
summaries[file] = covered.join(''); | |||
summaries[file] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change to jest-phabricator
, necessary to support the JSON lines format.
Technically, before it was breaking the contract provided by TypeScript by just returning an any
... I've typed it correctly now.
@@ -19,6 +18,8 @@ import {Config} from '@jest/types'; | |||
import { | |||
AggregatedResult, | |||
makeEmptyAggregatedTestResult, | |||
formatTestResult, | |||
formatTestResults, | |||
} from '@jest/test-result'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why weren't these being imported from @jest/test-result
before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed it when refactoring. Will be good to trim out exports from jest-util for 25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing changelog 😀
I'm also missing a test or two, but the implementation looks solid to me 👌
@@ -253,9 +337,10 @@ export default (async function runJest({ | |||
await runGlobalHook({allTests, globalConfig, moduleName: 'globalTeardown'}); | |||
} | |||
|
|||
return processResults(results, { | |||
return await processResults(results, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now async, since for JSON lines it'll now wait on stdout for buffering output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole function is async already, await
ing here just creates an extra promise instead of returning the promise from processResults
Looks good! Do you think it makes sense having this as a reporter as well? |
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
JSON output, especially as currently implemented, has a few limitations:
It's worth noting that the OOMs caused by these issues are not theoretical. :)
Related PR:
#8091
This PR is the first step to resolving these problems. There is clearly still room for improvement-- all output is still batched at the end, for example. All feedback welcomed.
Example output:
Test plan