Skip to content

Unable to debug files in test that are not tests #2034

Closed

Description

@bergwerf

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).

Activity

  1. DanTup commented on Oct 7, 2019

    @DanTup
    Member

    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?

  2. added this to the v3.6.0 milestone on Oct 7, 2019
  3. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    in testingRelates to test execution of Dart/Flutter tests for end users
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Oct 7, 2019
  4. bergwerf commented on Oct 7, 2019

    @bergwerf
    Author
  5. DanTup commented on Oct 7, 2019

    @DanTup
    Member

    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.

  6. DanTup commented on Oct 7, 2019

    @DanTup
    Member

    @bergwerf I can't reproduce a hang, it seems to run my non-test script fine:

    Screenshot 2019-10-07 at 2 08 04 pm

    Are you doing anything different? Could you capture a log using Dart: Capture Logs (leave everything ticked except Analysis Server).

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin testingRelates to test execution of Dart/Flutter tests for end usersis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions