-
-
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
[WIP][Proposal] Report progress of individual test cases #9001
Conversation
@SimenB @thymikee @cpojer @rickhanlonii @scotthovestadt I was wondering if you all had some thoughts on this 🙃 |
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.
Hey @rogeliog, sorry about the slow response! Swamped at work for the last month...
I know @scotthovestadt has worked on a streaming report thing over in #8242 - would this PR help implement that? Would be great to coordinate a bit, as they solve two sides of the same issue (I think?)
Would it make sense to land the parts of this that makes sense on its own (if any)? E.g. moving to event based architecture for reporters makes sense to me regardless of this feature landing. Same with sending custom messages with jest-worker
. I might be wrong though, and they make more sense together
(I just skimmed the code, I'd need to sit down and properly read this through to review properly, which I currently don't have the time for...)
@@ -52,6 +54,7 @@ export const initialize = ({ | |||
localRequire: (path: Config.Path) => any; | |||
testPath: Config.Path; | |||
parentProcess: Process; | |||
sendMessageToJest?: Function; |
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.
type it properly?
const valuesForCurrentTestCases = getValuesCurrentTestCases( | ||
options ? options.currentTestCases : [], | ||
); | ||
// console.log(aggregatedQuickStats.numPassingTests); |
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.
remove?
(testsTodo ? chalk.bold.magenta(`${testsTodo} todo`) + ', ' : '') + | ||
(testsPassed ? chalk.bold.green(`${testsPassed} passed`) + ', ' : '') + | ||
`${testsTotal} total`; | ||
(testsFailed |
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.
woah, hard to read. thoughts on a .map().filter().join()
instead? might not help, dunno. if not, maybe a helper of some sort?
What is the progress of the PR? |
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. |
This is a big PR and it has a lot of stuff that is still pending, but I think it is a good place to start the conversation of how we can solve #6616.
Before
After
I would love to get feedback on what would be good APIs for all of this.
cc: @SimenB @thymikee @cpojer @aaronabramov
This PR basically does the following things:
jest-worker
to send custom messages back to the main process, so that we can notify when a test case is done.Concerns and more
testRunnter.__PRIVATE_UNSTABLE_API_supportsEventEmmiters__
as a temporary solution.jest-worker
to handle custom messages, which is to extend the Promise interface to have a.onCustomMessage(cb)
. @mjesun I'm sure you might a better solution than me.AssertionResult
for each test case in each test suite. If this does have a perf hit, we could be smarter on this and potentially throttle and batch them.Assuming that we resolve the issues mentioned above, these items are still pending.