Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/very_good_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:

- name: Run Tests
run: |
flutter pub global activate coverage
flutter pub run test -j 1 -x pull-request-only -x e2e --coverage=coverage --test-randomize-ordering-seed random && dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
flutter pub global activate coverage 1.2.0
flutter pub run test -j 1 -x pull-request-only -x e2e --coverage=coverage --test-randomize-ordering-seed random && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib

- name: Check Code Coverage
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions lib/src/cli/flutter_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ Future<int> _flutterTest({
}
},
onError: (Object error, StackTrace stackTrace) {
subscription.cancel();
completer.completeError(error, stackTrace);
stderr('$clearLine$error');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test process throws errors for warnings and it turns out we actually don't want to treat those as errors and instead just propagate them to stderr for the user to see without terminating the process.

stderr('$clearLine$stackTrace');
},
);

Expand Down
10 changes: 4 additions & 6 deletions test/src/cli/flutter_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void main() {
);
});

test('throws when process fails (with cleanup)', () async {
test('exits with code 69 when process fails (with cleanup)', () async {
final directory = Directory.systemTemp.createTempSync();
final testDirectory = Directory(p.join(directory.path, 'test'))
..createSync();
Expand All @@ -322,22 +322,20 @@ void main() {
.writeAsStringSync(testContents);
await expectLater(
Flutter.test(cwd: directory.path, optimizePerformance: true),
throwsA(
'''Error: Couldn't resolve the package 'test' in 'package:test/test.dart'.''',
),
completion(equals([69])),
);
await File(
p.join(testDirectory.path, '.test_runner.dart'),
).ensureDeleted();
});

test('throws when there is no test directory', () {
test('exits with code 69 when there is no test directory', () {
final directory = Directory.systemTemp.createTempSync();
File(p.join(directory.path, 'pubspec.yaml')).writeAsStringSync(pubspec);

expectLater(
Flutter.test(cwd: directory.path),
throwsA('Test directory "test" not found.'),
completion(equals([69])),
);
});

Expand Down