Skip to content

Commit c65c473

Browse files
author
Anna Gringauze
authored
Allow running build daemon tests in canary mode (#2171)
* Add canary option for build daemon tests * Updated build_web_compilers and added tests * Fix webdev test failure * Updated PR reference and built
1 parent f0ba743 commit c65c473

File tree

22 files changed

+57
-21
lines changed

22 files changed

+57
-21
lines changed

dwds/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Require clients to specify the `basePath` on `AssetReader`. - [#2160](https://github.com/dart-lang/webdev/pull/2160)
44
- Update SDK constraint to `>=3.1.0-254.0.dev <4.0.0`. - [#2169](https://github.com/dart-lang/webdev/pull/2169)
5+
- Require min `build_web_compilers` version `4.0.4` - [#2171](https://github.com/dart-lang/webdev/pull/2171)
56

67
## 19.0.2
78

dwds/debug_extension/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818

1919
dev_dependencies:
2020
build: ^2.0.0
21-
build_web_compilers: ^4.0.0
21+
build_web_compilers: ^4.0.4
2222
build_runner: ^2.4.0
2323
built_collection: ^5.0.0
2424
dwds: ^11.0.0

dwds/debug_extension_mv3/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dev_dependencies:
1818
build_runner: ^2.4.0
1919
built_collection: ^5.0.0
2020
built_value_generator: ^8.3.0
21-
build_web_compilers: ^4.0.0
21+
build_web_compilers: ^4.0.4
2222
dwds: ^16.0.0
2323
sse: ^4.1.2
2424
web_socket_channel: ^2.2.0

dwds/lib/src/services/expression_compiler_service.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class _Compiler {
6868
bool soundNullSafety,
6969
SdkConfiguration sdkConfiguration,
7070
List<String> experiments,
71+
bool canaryFeatures,
7172
bool verbose,
7273
) async {
7374
sdkConfiguration.validateSdkDir();
@@ -95,6 +96,7 @@ class _Compiler {
9596
if (verbose) '--verbose',
9697
soundNullSafety ? '--sound-null-safety' : '--no-sound-null-safety',
9798
for (final experiment in experiments) '--enable-experiment=$experiment',
99+
if (canaryFeatures) '--canary',
98100
];
99101

100102
_logger.info('Starting...');
@@ -240,6 +242,7 @@ class ExpressionCompilerService implements ExpressionCompiler {
240242
final String _address;
241243
final FutureOr<int> _port;
242244
final List<String> experiments;
245+
final bool canaryFeatures;
243246
final bool _verbose;
244247

245248
final SdkConfigurationProvider sdkConfigurationProvider;
@@ -250,6 +253,7 @@ class ExpressionCompilerService implements ExpressionCompiler {
250253
bool verbose = false,
251254
required this.sdkConfigurationProvider,
252255
this.experiments = const [],
256+
this.canaryFeatures = false,
253257
}) : _verbose = verbose;
254258

255259
@override
@@ -287,6 +291,7 @@ class ExpressionCompilerService implements ExpressionCompiler {
287291
soundNullSafety,
288292
await sdkConfigurationProvider.configuration,
289293
experiments,
294+
canaryFeatures,
290295
_verbose,
291296
);
292297

dwds/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dev_dependencies:
4343
build_daemon: ^4.0.0
4444
build_runner: ^2.4.0
4545
build_version: ^2.1.1
46-
build_web_compilers: ^4.0.0
46+
build_web_compilers: ^4.0.4
4747
built_value_generator: ^8.3.0
4848
dart_code_metrics: ^5.5.0
4949
graphs: ^2.1.0

dwds/test/fixtures/context.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ class TestContext {
225225
],
226226
for (final experiment in experiments)
227227
'--enable-experiment=$experiment',
228+
if (canaryFeatures) ...[
229+
'--define',
230+
'build_web_compilers|ddc=canary=true',
231+
'--define',
232+
'build_web_compilers|sdk_js=canary=true',
233+
],
228234
'--verbose',
229235
];
230236
_daemonClient = await connectClient(
@@ -265,6 +271,7 @@ class TestContext {
265271
verbose: verboseCompiler,
266272
sdkConfigurationProvider: sdkConfigurationProvider,
267273
experiments: experiments,
274+
canaryFeatures: canaryFeatures,
268275
);
269276
expressionCompiler = ddcService;
270277
}

dwds/test/instances/instance_canary_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ void main() {
1818
// Enable verbose logging for debugging.
1919
final debug = false;
2020

21-
_runAllTests(
22-
canaryFeatures: true,
23-
compilationMode: CompilationMode.frontendServer,
24-
debug: debug,
25-
);
21+
for (var compilationMode in CompilationMode.values) {
22+
_runAllTests(
23+
canaryFeatures: true,
24+
compilationMode: compilationMode,
25+
debug: debug,
26+
);
27+
}
2628
}
2729

2830
void _runAllTests({

dwds/test/instances/instance_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void main() {
2323
final provider = TestSdkConfigurationProvider(verbose: debug);
2424
tearDownAll(provider.dispose);
2525

26-
for (var compilationMode in [CompilationMode.frontendServer]) {
26+
for (var compilationMode in CompilationMode.values) {
2727
_runTests(
2828
provider: provider,
2929
compilationMode: compilationMode,

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ environment:
88

99
dev_dependencies:
1010
build_runner: ^2.4.0
11-
build_web_compilers: ^4.0.0
11+
build_web_compilers: ^4.0.4

fixtures/_experimentSound/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ dependencies:
1313

1414
dev_dependencies:
1515
build_runner: ^2.4.0
16-
build_web_compilers: ^4.0.0
16+
build_web_compilers: ^4.0.4

0 commit comments

Comments
 (0)