flutter / flutter/flutter-intellij
Trying to run a single test in Flutter runs all tests that start with the same prefix string
- Dominant language
- Java
- Stars
- 2k
- Forks
- 356
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 27
Description
I am using Android Studio to create a Flutter application.
Using Android Studio, create the default "counter" Flutter project. Add two test cases to `widget_test.dart` like this:
```dart
test('abc', () {
print('Called abc.');
});
test('abc 2', () {
print('Called abc 2');
});
```
Use the widget in the left gutter to run the first test case. Note that the tooltip text says "Run 'abc'" or "Debug 'abc'". The run configuration stored in Android Studio is also called "abc". From this, it looks like only that one test should run, but the console shows that both tests are executed.
Note that if one opens the "Run/Debug Configurations" dialog box, the descriptive text under "Test Name" is actually "Some pattern to match test names by." This is significantly different from the rest of the user experience, where it looks like this is the precise name of the test to run, not a pattern by which all matching tests will run.
It seems to me that a command that says "Run 'abc'" should do only that.
Studio Build: Build #AI-243.25659.59.2432.13423653, built on April 29, 2025
Runtime version: 21.0.7+9-b631.52 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Flutter version: 3.29.3 channel stable
Flutter Plugin: 85.3.1
OS: Ubuntu 24.04.2 LTS
Contributor guide
Research direction
Reproduce the behavior in Android Studio with the default Flutter counter project's widget_test.dart and the two test names shown in the report. Start by tracing how the Flutter test run configuration handles the Test Name pattern; done means running 'abc' executes only that test rather than tests sharing its prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter, java
- Domain
- developer-experience, testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100