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
If you have a small repro, I'd be interested to know went wrong in the VS Code plugin. Even if the error messages are obscure, that shouldn't cause any bad behaviour in the test runner. Maybe there are edge cases not being handled correctly?
Ok, I think I figured this out... This feature works using the UNIT_TEST_TEST items in the OUTLINE notification. It seems like in the file above, we only get a UNIT_TEST_TEST for one test - the one that uses testWidgets, not the others (you can see the outine tree on the left here, and the code on the right):
I did some digging through the server code, and it seems that in order to be considered a test call, the method (being called) needs to:
Be called test and live inside the test package
Be annotated with @isTest
It seems that testWidget is annotated with @isTest but test from flutter_test is not. I think the way to fix this would be to add the @isTest annotation to the test method inside flutter_test that is being called here. I do not know if there are any side-effects of that though :-)
I think the change may be safe, it seems like it's just a marker annotation that doesn't really do much. @scheglov maybe you can confirm - you added it to testWidget (flutter/flutter#17772) - do you expect it's safe to add this to the test function here?
Activity
DanTup commentedon Jan 24, 2019
As far as I'm aware, this all already works! :)
If you're seeing issues, can you provide more info on what your project/code looks like and where you're seeing the failure?
xster commentedon Jan 30, 2019
I only reproduced it in this case. flutter/flutter#27002. Which isn't really supported anyway. Closing
DanTup commentedon Jan 30, 2019
If you have a small repro, I'd be interested to know went wrong in the VS Code plugin. Even if the error messages are obscure, that shouldn't cause any bad behaviour in the test runner. Maybe there are edge cases not being handled correctly?
xster commentedon Jan 31, 2019
Actually maybe it doesn't work. Try https://github.com/flutter/flutter/blob/master/packages/flutter/test/rendering/editable_test.dart. F5 works on that file but they aren't per-method debuggable in the editor UI.
DanTup commentedon Jan 31, 2019
Ok, I think I figured this out... This feature works using the
UNIT_TEST_TESTitems in theOUTLINEnotification. It seems like in the file above, we only get aUNIT_TEST_TESTfor one test - the one that usestestWidgets, not the others (you can see the outine tree on the left here, and the code on the right):I did some digging through the server code, and it seems that in order to be considered a test call, the method (being called) needs to:
testand live inside thetestpackage@isTestIt seems that
testWidgetis annotated with@isTestbuttestfromflutter_testis not. I think the way to fix this would be to add the@isTestannotation to thetestmethod inside flutter_test that is being called here. I do not know if there are any side-effects of that though :-)DanTup commentedon Jan 31, 2019
I think the change may be safe, it seems like it's just a marker annotation that doesn't really do much. @scheglov maybe you can confirm - you added it to
testWidget(flutter/flutter#17772) - do you expect it's safe to add this to thetestfunction here?scheglov commentedon Jan 31, 2019
It looks like a copy of
package:test, so yes, I thinktestandgroupfunctions also should be marked as@isTestand@isTestGroup.DanTup commentedon Feb 5, 2019
I've opened a PR at flutter/flutter#27532.
Add @istest to Flutter's wrappers over group/test (#27532)
DanTup commentedon Feb 5, 2019
Fixed in Flutter
master, thanks for the report!Add @istest to Flutter's wrappers over group/test (flutter#27532)