JSON reporter output appears in Debug Console and results not updated when writing output to stdout without newlines
See original GitHub issuevoid main() {
test('foo', () {
stdout.write('foo');
});
}
Using writeln
prevents the issue.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
python - How do you get VS Code to write Debug stdout to the ...
When I try to print out any statement, such as using > print("here") I do not get any output to the Debug Console....
Read more >Pylint output - Pylint 2.16.0-dev documentation
Output by default is written to stdout. The simplest way to output to a file is with the --output=<filename> option. The default format...
Read more >Debugging - Cypress Documentation
You can see a walk-through of debugging some application code from Cypress in this segment from our React tutorial series. Get console logs...
Read more >Component Reference - Apache JMeter - User's Manual
Several test elements use JMeter properties to control their behaviour. These properties are normally resolved when the class is loaded.
Read more >Configuration File | API | Docs - TestCafe
You can use multiple reporters, but note that only one reporter can write to stdout . All other reporters must output to files....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I looked into this a little bit, and chatted with @natebosch about it as well.
There are a few challenges involved generally, such as what to do if somebody writes arbitrary bytes, the fact that reporters can’t unconditionally import dart:io at all, etc. Also customizing things just for the json reporter also is not very clean to do and would require a fair bit of plumbing.
The general consensus we reached is as follows:
print
messages, probably using the line splitter to only send messages when we get a newline (this would be a bit of a behavior change if we wait for newlines). We may prefix the strings withStdout:
and/orStderr:
etc.If people are relying on the existing behavior in some way, we can address that on a case by case basis, but most likely the answer will just be that they should use their own IOOverrides to get different behavior if needed.
Sounds reasonable to me. Since it sounds like this can all be solved in
pkg:test
, I’ve opened https://github.com/dart-lang/test/issues/1749 and will close this one.