Skip to content

Commit 36e2212

Browse files
committed
Add support for hot restart tests in DWDS with the frontend server
- Aligns the bootstrap script with Flutter tools for the DDC library bundle format. This includes adding the dartReloadModifiedModules callback and the script to wait until all sources are loaded before calling main. - Aligns the recompile code with Flutter tools. This includes adding support for detecting invalidated files, using recompile-restart, and writing a script that DWDS can use to detect files for a hot restart. - Refactors hot restart tests into shared test code that is now tested both with the build daemon and the frontend server. Tests that rely on build events are skipped in the frontend server by design and tests that rely on deferring main are skipped with the new DDC library bundle format until dart-lang/sdk#60528 is resolved. Tests are also renamed to use "restart" instead of "reload" to distinguish from hot reload tests, which will be added in a future CL.
1 parent c8b1cfa commit 36e2212

13 files changed

+1403
-905
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
@TestOn('vm')
6+
@Tags(['daily'])
7+
@Timeout(Duration(minutes: 2))
8+
library;
9+
10+
import 'package:dwds/expression_compiler.dart';
11+
import 'package:test/test.dart';
12+
import 'package:test_common/test_sdk_configuration.dart';
13+
14+
import 'common/hot_restart_correctness_common.dart';
15+
import 'fixtures/context.dart';
16+
17+
void main() {
18+
// Enable verbose logging for debugging.
19+
final debug = false;
20+
final canaryFeatures = false;
21+
final moduleFormat = ModuleFormat.amd;
22+
final compilationMode = CompilationMode.buildDaemon;
23+
24+
final provider = TestSdkConfigurationProvider(
25+
verbose: debug,
26+
canaryFeatures: canaryFeatures,
27+
ddcModuleFormat: moduleFormat,
28+
);
29+
30+
runTests(
31+
provider: provider,
32+
moduleFormat: moduleFormat,
33+
compilationMode: compilationMode,
34+
canaryFeatures: canaryFeatures,
35+
debug: debug,
36+
);
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
@TestOn('vm')
6+
@Tags(['daily'])
7+
@Timeout(Duration(minutes: 2))
8+
library;
9+
10+
import 'package:dwds/expression_compiler.dart';
11+
import 'package:test/test.dart';
12+
import 'package:test_common/test_sdk_configuration.dart';
13+
14+
import 'common/hot_restart_common.dart';
15+
import 'fixtures/context.dart';
16+
17+
void main() {
18+
// Enable verbose logging for debugging.
19+
final debug = false;
20+
final canaryFeatures = false;
21+
final moduleFormat = ModuleFormat.amd;
22+
final compilationMode = CompilationMode.buildDaemon;
23+
24+
final provider = TestSdkConfigurationProvider(
25+
verbose: debug,
26+
canaryFeatures: canaryFeatures,
27+
ddcModuleFormat: moduleFormat,
28+
);
29+
30+
runTests(
31+
provider: provider,
32+
moduleFormat: moduleFormat,
33+
compilationMode: compilationMode,
34+
canaryFeatures: canaryFeatures,
35+
debug: debug,
36+
);
37+
}

0 commit comments

Comments
 (0)