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

fix(logs): collect logs per test #1088

Merged
merged 8 commits into from Apr 4, 2022
Merged

fix(logs): collect logs per test #1088

merged 8 commits into from Apr 4, 2022

Conversation

userquin
Copy link
Member

@userquin userquin commented Apr 3, 2022

For context:

The log spy currently uses a single buffer to collect all the logs from all the tests, when sending the logs to the reporters, there is no way of knowing which tests each of the logs correspond to, so as soon as are sent, all the logs that are collected in the corresponding tick are shown as corresponding to the current test:

imagen

This PR also separates the timers by tests, since otherwise we can lose logs:

imagen

PR #1086 by @sheremet-va fixed the identifier of the test to which the collected logs belong, but when they are sent we still have the problem that all the ones in the buffer are sent, so the logs of other tests will be included under the running test at tick.

This PR includes the current logic but separated by test, so that the logs are collected and included in their own buffer and thus, when sent to the reporters the logs are shown where they belong:

imagen

and for ui (the tab title on console should be 4, fixed also in this PR):

imagen

@netlify
Copy link

netlify bot commented Apr 3, 2022

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit c312289
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/624b03058162240009c82adc
😎 Deploy Preview https://deploy-preview-1088--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@userquin userquin requested a review from antfu April 3, 2022 14:57
@userquin userquin requested a review from antfu April 4, 2022 10:35
@antfu antfu merged commit b24fb25 into main Apr 4, 2022
@antfu antfu deleted the userquin/fix-logs branch April 4, 2022 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants