Skip to content
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

Streaming individual test results #6225

Closed
SimenB opened this issue May 22, 2018 · 6 comments
Closed

Streaming individual test results #6225

SimenB opened this issue May 22, 2018 · 6 comments

Comments

@SimenB
Copy link
Member

SimenB commented May 22, 2018

🚀 Feature Proposal

Right now we collect test results from a whole suite before passing it to a testResultsProcessor (and printing it). I'd like to also be able to know as each individual test completes without waiting for the whole suite.

Motivation

2 use cases comes to mind:

  1. IDEs and other reporters are able to display individual test results as they come in, instead of waiting for the whole suite
  2. Tracking down which test hangs a test suite (see Upgrade jest webpack/webpack#7311 which just hangs - seeing the last completed test would be great)

As a bonus to the last point, we might want to stream multiple states per test - pending, running and complete or something might make sense.

Example

Not really sure how it would be used. I guess an extra method in the reporter? Might make sense as part of Jest Hooks? https://github.com/facebook/jest/blob/master/packages/jest-cli/src/jest_hooks.js

Pitch

The UI for it does not have to live within Jest, but we should power custom reporters and test result processors to display real time data about a test suite

@SimenB
Copy link
Member Author

SimenB commented May 27, 2018

Now that I've gotten a primer on jest-circus, I guess this can be closed. It'll work out of the box (as long as one does not have an afterAll which the suite will have to wait for).

#4471 is pretty much the same thing anyways, so closing.

@SimenB SimenB closed this as completed May 27, 2018
@aaronabramov
Copy link
Contributor

@SimenB those are still two different reporting mechanisms:

  1. reporting in jest via different reorters "coverage, default, summary, etc."
  2. sending flux actions within jest-circus - that has no way outside its current vm though

afterAll shouldn't be a problem any more, we chose to not fail any individual tests, but rather throw a global error that'll fail the whole suite

@SimenB
Copy link
Member Author

SimenB commented May 29, 2018

Would it be possible to emit events from jest-circus outside of the vm as well?

@aaronabramov
Copy link
Contributor

yes, but it'll introduce the whole world of parallelism, since we'll be running a lot of tests in parallel, the events will need to be handled differently :)

@SimenB
Copy link
Member Author

SimenB commented May 29, 2018

Good point. Namespacing in test file name or something (maybe combined with runner?) might be enough?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants