You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The gutter icons in test files appear in the wrong lines. This also affects the in-line stack trace boxes that pop up when a test fails.
To Reproduce
Steps to reproduce the behavior:
create a fresh flutter project with the cli: flutter create new_project
open VSCode and open the new_project folder
Go to test/widget_test.dart
Make a change to make the test fail (e.g. change the '0' to '1' in line 19)
Run the test (by clicking on the inline run button)
Expected behavior
The gutter icon of the test should be at line 14 where the test is defined. The test's failure stack trace should also appear there.
Actual behavior
Instead the gutter icon is at line 31. It is consistent across VSCode and OS restarts,
Screenshots
This issue started happening to me since about 3 days ago. Regrettably I can't pin point it to updating something that might have broken it. I hope somebody who has a setup like mine can replicate it
Please complete the following information:
Operating System and version: Windows 10 Home, version 22H2, build 19045.2965
We currently blindly assume if there's not root_ values, then the standard values are usable, but here not what we want (and we're trying to put the marker on line 153).
This might be Windows-specific, so I'll try on there shortly and investigate further.
We currently blindly assume if there's not root_ values, then the standard values are usable, but here not what we want (and we're trying to put the marker on line 153).
Can confirm, when I artificially lengthen the test tfile to >153 lines the gutter icon jumps to line 153.
This was fixed via dart-lang/test#2037. I think Flutter pins the version of the test package so the fix will show up in a future release. For Dart, you should be able to update to the latest version of test yourself.
Activity
DanTup commentedon Jun 14, 2023
Could you try capturing debugging logs while reproducing this?
Thanks!
Snonky commentedon Jun 14, 2023
Here is the gist along with a video of my editor while the log was created.
Video
dart-code_blurred.mp4
DanTup commentedon Jun 15, 2023
Thanks for the log - it seems the JSON when running your test is not providing all of the data. When it works for me, I have a payload like:
The
root_...fields are the important ones.In your log, it looks like this:
We currently blindly assume if there's not
root_values, then the standard values are usable, but here not what we want (and we're trying to put the marker on line 153).This might be Windows-specific, so I'll try on there shortly and investigate further.
DanTup commentedon Jun 15, 2023
Confirmed I can repro this on Windows. Opened dart-lang/test#2037.
Snonky commentedon Jun 15, 2023
Can confirm, when I artificially lengthen the test tfile to >153 lines the gutter icon jumps to line 153.
DanTup commentedon Jul 11, 2023
This was fixed via dart-lang/test#2037. I think Flutter pins the version of the test package so the fix will show up in a future release. For Dart, you should be able to update to the latest version of
testyourself.