Open bartekpacia opened 1 year ago
Is this a place to add the error messages for why a test failed? Or would it be kept separate?
No. To find you why a test failed, you'd have to still look in the logs.
I mean, I don't know how we could make it fit in 1 line and make it look good.
From my perspective: I need a place, where I can easily find info about which test failed and why. Logs are quite hard to read (at least now), that's why I'm asking.
Jest prints, apart from the passed/failed marker, a summary of failed tests at the end of the output. This is, IMO, quite good middle-ground between being fancy (so a pass/fail colored marker) and being useful. If everything passes you have clean output, if something fails, you see what failed right there, without looking for it.
@jakubfijalkowski Jest is great, and its equivalent in Dart is spec (in this context I mean spec_cli, the interactive tester runner) . I use it often and it just works and improves test readability.
Maybe we should look for ways to integrate with them, or borrow their interactive test runner code :)
Cross-referencing #528
@bartekpacia yes, something like this would be awesome, our QE says patrol is awesome but hard to find the issues in the log etc.
Yeah, we're aware of it. We hope to improve this!
For now, you can use flutter logs
while running patrol test
to view Dart-side logs.
This is a possible duplicate of #870.
We could print a nice test result summary, similar to what
spec
does:Without colors it looks like this:
For Patrol, I'd like to print something like this:
Code already written
Some code that would go in #560 but I decided it doesn't fit there. ```dart // TODO: Use this class SingleTargetRunResult { SingleTargetRunResult({ required this.target, required this.device, required this.plannedRuns, this.buildPassed = false, required this.runs, }); final String target; final Device device; bool buildPassed; final int plannedRuns; final List> run() {} ``` - This would make code in `DriveCommand` cleaner (it'd be moved to `TestRunner`) - All the complexity would be contained inside `TestRunner` and properly tested
To be precise, this issue is only about nicer logs in the CLI, not about detailed error reporting using
flutter test
with the JSON reporter to convert test logs into a JUnit format. See #421 and #495 for this.cc @jBorkowska @shilangyu @jakubfijalkowski – as always, if you have any thought about this, share them here :)