Skip to content

Running an individual unit test with flutter test needs an absolute path #278

Closed

Description

@HansMuller

The following commands run all tests and one specific unit test OK. CWD is the root of the flutter repo.

flutter test --debug
flutter test --debug /builds/dev/flutter/packages/unit/test/widget/bottom_sheet_test.dart 

Relative pathnames fail. For example:

flutter test --debug packages/unit/test/widget/bottom_sheet_test.dart
00:00 +0 -1: loading packages/unit/test/widget/bottom_sheet_test.dart                              
  Failed to load "packages/unit/test/widget/bottom_sheet_test.dart": Does not exist.
00:00 +0 -1: Some tests failed.         

The run_tests command used to accept paths relative to the unit directory. That doesn't work either:

flutter test --debug test/widget/bottom_sheet_test.dart
00:00 +0 -1: loading packages/unit/test/widget/bottom_sheet_test.dart                              
  Failed to load "packages/unit/test/widget/bottom_sheet_test.dart": Does not exist.
00:00 +0 -1: Some tests failed.         

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    c: regressionIt was better in the past than it is now
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Nov 10, 2015
  2. Hixie commented on Nov 10, 2015

    @Hixie
    Contributor

    As a temporary workaround, does "widget/bottom_sheet_test.dart" work?

  3. HansMuller commented on Nov 11, 2015

    @HansMuller
    ContributorAuthor

    That doesn't work but an absolute pathname does. This isn't blocking me.

  4. github-actions commented on Sep 7, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Sep 7, 2021
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

    a: tests"flutter test", flutter_test, or one of our testsc: regressionIt was better in the past than it is nowtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions