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
{{ message }}
Debugging flutter tests fail if the descrription string has an interpolated value and a is composed of two concatenated strings #4250
Connecting to VM Service at http://127.0.0.1:64510/Y0ktArhJg9g=/ws
No tests match regular expression "^Start string .* " " end string( \(variant: .*\))?$".
Exited (1)
In the next release (and the pre-release version just pushed today - v3.63.20240419), you can choose to have tests executed using their line numbers rather than their names. This fixes a number of issues including this one, caused by not always being able to statically compute the exact name of a test.
Please let me know if you find any issues with this functionality!
One obvious solution is to insist that test names are static.
IMO it is bad practice to put dynamic data there
Yeah, I think there has been discussion about a lint to enforce this. But there are a lot of tests out there today that do it and I don't think the test runner here should just be broken. There were a bunch of other related issues (not strictly about using variables in names, but just using some helper/wrapper functions that made it difficult to run tests) and the fix for them all was the same so it was worth handling :-)
Activity
DanTup commentedon Nov 7, 2022
Merging this into #4021 since that should fix a number of issues with non-trivial test names like this one.
DanTup commentedon Apr 18, 2023
Re-opening this for tracking to ensure this issue is fixed by the upcoming support for running tests by lines.
Add tests for several issues requiring running tests by line
Add tests for several issues requiring running tests by line
Add tests for several issues requiring running tests by line
Add tests for several issues requiring running tests by line
DanTup commentedon Apr 19, 2023
In the next release (and the pre-release version just pushed today - v3.63.20240419), you can choose to have tests executed using their line numbers rather than their names. This fixes a number of issues including this one, caused by not always being able to statically compute the exact name of a test.
Please let me know if you find any issues with this functionality!
WorikQCI commentedon Apr 19, 2023
I have been away from VSCode so I have not been paying attention.
One obvious solution is to insist that test names are static.
IMO it is bad practice to put dynamic data there, and I no longer d it. The test should have the same name each time it is run.
I hope this makes sense, as I say I am away from VSCode so you do not have my full attention!
thank you for all your work!
DanTup commentedon Apr 20, 2023
Yeah, I think there has been discussion about a lint to enforce this. But there are a lot of tests out there today that do it and I don't think the test runner here should just be broken. There were a bunch of other related issues (not strictly about using variables in names, but just using some helper/wrapper functions that made it difficult to run tests) and the fix for them all was the same so it was worth handling :-)