forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues running integration tests through DAP debug adapter (#104618)
* Fix issues running integration tests through DAP These adapters were incorrectly trying to connect a DDS instance even when Flutter would create its own. This change disables DDS in the DAP layer and leaves it to Flutter (although it passes `--no-dds` on to Flutter if provided to the DAP process). Also fixes an issue where we would unnecessarily connect the VM Service for tests even in 'noDebug' mode because of a change/fix that now includes a 'vmServiceUri' in the `test.startedProcess` event.
- Loading branch information
Showing
5 changed files
with
171 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
packages/flutter_tools/test/integration.shard/test_data/integration_tests_project.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2014 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:file/file.dart'; | ||
import 'package:flutter_tools/src/base/file_system.dart'; | ||
|
||
import '../test_utils.dart'; | ||
import 'project.dart'; | ||
import 'tests_project.dart'; | ||
|
||
class IntegrationTestsProject extends Project implements TestsProject { | ||
@override | ||
final String pubspec = ''' | ||
name: test | ||
environment: | ||
sdk: '>=2.12.0-0 <3.0.0' | ||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
dev_dependencies: | ||
integration_test: | ||
sdk: flutter | ||
flutter_test: | ||
sdk: flutter | ||
'''; | ||
|
||
@override | ||
String get main => '// Unused'; | ||
|
||
@override | ||
final String testContent = r''' | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
void main() { | ||
group('Flutter tests', () { | ||
testWidgets('can pass', (WidgetTester tester) async { | ||
expect(true, isTrue); // BREAKPOINT | ||
}); | ||
testWidgets('can fail', (WidgetTester tester) async { | ||
expect(true, isFalse); | ||
}); | ||
}); | ||
} | ||
'''; | ||
|
||
@override | ||
Future<void> setUpIn(Directory dir) { | ||
this.dir = dir; | ||
writeFile(testFilePath, testContent); | ||
return super.setUpIn(dir); | ||
} | ||
|
||
@override | ||
String get testFilePath => fileSystem.path.join(dir.path, 'integration_test', 'app_test.dart'); | ||
|
||
@override | ||
Uri get breakpointUri => throw UnimplementedError(); | ||
|
||
@override | ||
Uri get breakpointAppUri => throw UnimplementedError(); | ||
|
||
@override | ||
int get breakpointLine => throw UnimplementedError(); | ||
} |