Skip to content

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

Closed
@HansMuller

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.         

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