Skip to content

Commit

Permalink
test everythin
Browse files Browse the repository at this point in the history
  • Loading branch information
renancaraujo committed May 18, 2023
1 parent 0de7d71 commit 9b3e136
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
14 changes: 1 addition & 13 deletions lib/src/cli/flutter_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,7 @@ Future<int> _flutterTest({
if (optimizationApplied) {
// When there is a test error before any group is computed, it means
// that there is an error when compiling the test optimizer file.
if (groups.isEmpty) {
if (!event.isFailure && event.error.isCompilationError()) {
final relativeTestPath = p.relative(testPath, from: cwd);
failedTestErrorMessages[relativeTestPath] = [
'$prefix ${event.error}'
];
return;
}
} else {
if (groups.isNotEmpty) {
final topGroupName = _topGroupName(test, groups)!;

testPath = testPath.replaceFirst(
Expand Down Expand Up @@ -579,8 +571,4 @@ extension on String {
String toSingleLine() {
return replaceAll('\n', '').replaceAll(RegExp(r'\s\s+'), ' ');
}

bool isCompilationError() {
return contains('Compilation failed for');
}
}
2 changes: 1 addition & 1 deletion test/fixtures/test_runner_fixtures.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ List<Map<String, Object>> skipExceptionMessageJsonOutput(String cwd) => [
{'success': false, 'type': 'done', 'time': 5466},
];

List<Map<String, Object>> compulationErrorJsonOutput(String cwd) {
List<Map<String, Object>> compilationErrorJsonOutput(String cwd) {
return [
{
"protocolVersion": "0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion test/src/cli/flutter_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ void main() {
File(p.join(tempDirectory.path, 'pubspec.yaml')).createSync();

final testEventStream = Stream.fromIterable([
...compulationErrorJsonOutput(tempDirectory.path)
...compilationErrorJsonOutput(tempDirectory.path)
.map(TestEvent.fromJson),
const ExitTestEvent(exitCode: 1, time: 0),
]);
Expand Down

0 comments on commit 9b3e136

Please sign in to comment.