Skip to content

Commit 28a090e

Browse files
author
Anna Gringauze
authored
Run dwds tests in a copy of the sdk directory (#1989)
* Validate only needed summaries in expression_compiler_service * Move shared test functionality into test_common package * Rebase on master * Fix bad merge * Re-enable webdev weak null safety e2e tests * Create copy of the SDK for tests * Modify tests to run with sdk copy * Cleanup * Pull out project definitions into separate file * Add package name to the project and use it in tests * Fix sdk configiuration tests * Update instance_inspection tests * Less changes in chrome_proxy_service.dart * Run dwds tests in a copy of sdk directory * Fix failing tests * Fix test failures * Cleanup
1 parent b58d3eb commit 28a090e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+434
-266
lines changed

dwds/test/build_daemon_breakpoint_test.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
@TestOn('vm')
66
@Timeout(Duration(minutes: 2))
77

8-
import 'package:dwds/src/services/chrome_proxy_service.dart';
98
import 'package:test/test.dart';
9+
import 'package:test_common/test_sdk_configuration.dart';
1010
import 'package:vm_service/vm_service.dart';
1111

1212
import 'fixtures/context.dart';
1313
import 'fixtures/project.dart';
1414

15-
final context = TestContext(TestProject.testPackageWithSoundNullSafety());
15+
void main() {
16+
final provider = TestSdkConfigurationProvider();
17+
tearDownAll(provider.dispose);
1618

17-
ChromeProxyService get service => context.service;
19+
final context =
20+
TestContext(TestProject.testPackageWithSoundNullSafety(), provider);
1821

19-
void main() {
2022
group('shared context', () {
2123
setUpAll(() async {
2224
await context.setUp();
@@ -34,8 +36,10 @@ void main() {
3436
late ScriptRef mainScript;
3537
late String mainScriptUri;
3638
late Stream<Event> stream;
39+
late VmServiceInterface service;
3740

3841
setUp(() async {
42+
service = context.service;
3943
vm = await service.getVM();
4044
isolate = await service.getIsolate(vm.isolates!.first.id!);
4145
isolateId = isolate.id!;

dwds/test/build_daemon_callstack_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
@TestOn('vm')
66
@Timeout(Duration(minutes: 2))
7-
import 'dart:async';
87

9-
import 'package:dwds/src/services/chrome_proxy_service.dart';
108
import 'package:test/test.dart';
119
import 'package:test_common/logging.dart';
10+
import 'package:test_common/test_sdk_configuration.dart';
1211
import 'package:vm_service/vm_service.dart';
1312

1413
import 'fixtures/context.dart';
1514
import 'fixtures/project.dart';
1615

1716
void main() {
17+
final provider = TestSdkConfigurationProvider();
18+
tearDownAll(provider.dispose);
19+
1820
group(
1921
'shared context |',
2022
() {
@@ -24,7 +26,7 @@ void main() {
2426
for (var nullSafety in NullSafety.values) {
2527
group('${nullSafety.name} null safety |', () {
2628
final project = TestProject.testPackage(nullSafety: nullSafety);
27-
final context = TestContext(project);
29+
final context = TestContext(project, provider);
2830

2931
setUpAll(() async {
3032
setCurrentLogWriter(debug: debug);
@@ -40,7 +42,7 @@ void main() {
4042
});
4143

4244
group('callStack |', () {
43-
late ChromeProxyService service;
45+
late VmServiceInterface service;
4446
VM vm;
4547
late Isolate isolate;
4648
ScriptList scripts;
@@ -58,7 +60,7 @@ void main() {
5860
await service.streamListen('Debug');
5961
stream = service.onEvent('Debug');
6062

61-
final testPackage = project.packageName;
63+
final testPackage = context.project.packageName;
6264
mainScript = scripts.scripts!
6365
.firstWhere((each) => each.uri!.contains('main.dart'));
6466
testLibraryScript = scripts.scripts!.firstWhere((each) =>

dwds/test/build_daemon_circular_evaluate_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@Timeout(Duration(minutes: 2))
77

88
import 'package:test/test.dart';
9+
import 'package:test_common/test_sdk_configuration.dart';
910

1011
import 'evaluate_circular_common.dart';
1112
import 'fixtures/context.dart';
@@ -15,9 +16,13 @@ void main() async {
1516
// Enable verbose logging for debugging.
1617
final debug = false;
1718

19+
final provider = TestSdkConfigurationProvider(verbose: debug);
20+
tearDownAll(provider.dispose);
21+
1822
for (var nullSafety in NullSafety.values) {
1923
group('${nullSafety.name} null safety |', () {
2024
testAll(
25+
provider: provider,
2126
compilationMode: CompilationMode.buildDaemon,
2227
nullSafety: nullSafety,
2328
debug: debug,

dwds/test/build_daemon_evaluate_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@Timeout(Duration(minutes: 2))
77

88
import 'package:test/test.dart';
9+
import 'package:test_common/test_sdk_configuration.dart';
910

1011
import 'evaluate_common.dart';
1112
import 'fixtures/context.dart';
@@ -15,9 +16,13 @@ void main() async {
1516
// Enable verbose logging for debugging.
1617
final debug = false;
1718

19+
final provider = TestSdkConfigurationProvider(verbose: debug);
20+
tearDownAll(provider.dispose);
21+
1822
for (var nullSafety in NullSafety.values) {
1923
group('${nullSafety.name} null safety |', () {
2024
testAll(
25+
provider: provider,
2126
compilationMode: CompilationMode.buildDaemon,
2227
nullSafety: nullSafety,
2328
debug: debug,

0 commit comments

Comments
 (0)