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 }}
Repository navigation
Unable to debug files in test that are not tests #2034
I think this may be by design, but I just wanted to check. If I create a file in the test folder that does not use test or run tests (but for example a program that generates test data, or that collects a benchmark), then I cannot debug it (the debugger starts but doesn't do anything, it keeps 'loading' forever). If I put the file in bin, then the debugger works fine. I suppose the plugin assumes all files in test should use the test runner, but perhaps that is a bit too constraining? (at least it would be nice if I can put an option in the debug config to not do this).
This is slightly related to #2021 (and #1165). The current behaviour is that anything that ends with _test.dart or inside the top-level test directory is considered a test. The request in #2021 is to stop assuming everything ending with _test.dart, and this one is to not assume anything in test - though I'm not sure we can do both (we'd end up categorising nothing as tests).
Poking around inside the source to guess if they're tests seems more error prone (it's possible you don't directly use package:test in a test script, since you might have wrappers for groups/tests, like Flutter does). Maybe we could require being inside a test folder and end with _test.dart?
I suppose that's what pub run test does so that would make sense (in test
and _test.dart).
Isn't is possible to somehow exit if pub test can't run any tests (instead
of hanging, with a notification "can't find tests or something") or
fallback to normal debugging if pub test doest find any tests? At least now
it's not clear to the uses why it's hanging and how to solve it (feels like
a bug in the debugger).
On Mon, Oct 7, 2019, 10:08 Danny Tuppeny ***@***.***> wrote:
This is slightly related to #2021
<#2021> (and #1165
<#1165>). The current
behaviour is that anything that ends with _test.dart or inside the
top-level test directory is considered a test. The request in #2021
<#2021> is to stop assuming
everything ending with _test.dart, and this one is to not assume anything
in test - though I'm not sure we can do both (we'd end up categorising
nothing as tests).
Poking around inside the source to guess if they're tests seems more error
prone (it's possible you don't directly use package:test in a test
script, since you might have wrappers for groups/tests, like Flutter does).
Maybe we could require being inside a test folder *and* end with
_test.dart?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2034?email_source=notifications&email_token=ABCATVK27HJTZDIWRCTRQHTQNLVAVA5CNFSM4I5537PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPL7MQ#issuecomment-538886066>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCATVLML7OM4Q4OUK5AECDQNLVAVANCNFSM4I5537PA>
.
Activity
DanTup commentedon Oct 7, 2019
This is slightly related to #2021 (and #1165). The current behaviour is that anything that ends with
_test.dartor inside the top-leveltestdirectory is considered a test. The request in #2021 is to stop assuming everything ending with_test.dart, and this one is to not assume anything intest- though I'm not sure we can do both (we'd end up categorising nothing as tests).Poking around inside the source to guess if they're tests seems more error prone (it's possible you don't directly use
package:testin a test script, since you might have wrappers for groups/tests, like Flutter does). Maybe we could require being inside a test folder and end with_test.dart?bergwerf commentedon Oct 7, 2019
DanTup commentedon Oct 7, 2019
Yeah, it definitely shouldn't hang - it should fail and be obvious what's up. I'll take a look at that before I change the rules too.
DanTup commentedon Oct 7, 2019
@bergwerf I can't reproduce a hang, it seems to run my non-test script fine:
Are you doing anything different? Could you capture a log using Dart: Capture Logs (leave everything ticked except Analysis Server).
Thanks!