Skip to content

Commit 862ca5b

Browse files
sigurdmCommit Queue
authored andcommitted
Opt front_end_server test fixtures out of package_deps validation
Change-Id: Ia0e557f4546b32390675d0addd1a2004113a1a46 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404564 Reviewed-by: Jens Johansen <[email protected]> Reviewed-by: Devon Carew <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
1 parent 46c9c29 commit 862ca5b

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

pkg/frontend_server/pubspec.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@ dependencies:
2424
# Use 'any' constraints here; we get our versions from the DEPS file.
2525
dev_dependencies:
2626
collection: any
27-
const_finder_fixtures: any
28-
const_finder_fixtures_package: any
2927
lints: any
3028
test: any

pkg/frontend_server/test/const_finder_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void _checkConsts(String dillPath, Compiler compiler) {
142142
expectation['nonConstantLocations'] = <Object?>[
143143
<String, dynamic>{
144144
'file': 'file://$fixturesUrl/pkg/package.dart',
145-
'line': 13,
145+
'line': 17,
146146
'column': 25,
147147
},
148148
];
@@ -256,27 +256,27 @@ void _checkNonConstsFrontend(String dillPath, Compiler compiler) {
256256
'nonConstantLocations': <dynamic>[
257257
<String, dynamic>{
258258
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
259-
'line': 13,
259+
'line': 17,
260260
'column': 26,
261261
},
262262
<String, dynamic>{
263263
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
264-
'line': 16,
264+
'line': 20,
265265
'column': 7,
266266
},
267267
<String, dynamic>{
268268
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
269-
'line': 16,
269+
'line': 20,
270270
'column': 22,
271271
},
272272
<String, dynamic>{
273273
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
274-
'line': 17,
274+
'line': 21,
275275
'column': 26,
276276
},
277277
<String, dynamic>{
278278
'file': 'file://$fixturesUrl/pkg/package.dart',
279-
'line': 13,
279+
'line': 17,
280280
'column': 25,
281281
}
282282
]
@@ -343,27 +343,27 @@ void _checkNonConstsWeb(String dillPath, Compiler compiler) {
343343
'nonConstantLocations': <dynamic>[
344344
<String, dynamic>{
345345
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
346-
'line': 13,
346+
'line': 17,
347347
'column': 26,
348348
},
349349
<String, dynamic>{
350350
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
351-
'line': 16,
351+
'line': 20,
352352
'column': 7,
353353
},
354354
<String, dynamic>{
355355
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
356-
'line': 16,
356+
'line': 20,
357357
'column': 22,
358358
},
359359
<String, dynamic>{
360360
'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
361-
'line': 17,
361+
'line': 21,
362362
'column': 26,
363363
},
364364
<String, dynamic>{
365365
'file': 'file://$fixturesUrl/pkg/package.dart',
366-
'line': 13,
366+
'line': 17,
367367
'column': 25,
368368
}
369369
],
@@ -581,4 +581,4 @@ class Dart2JSDeepCollectionEquality extends DeepCollectionEquality {
581581
}
582582
return super.equals(e1, e2);
583583
}
584-
}
584+
}

pkg/frontend_server/test/fixtures/lib/consts.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// This test is always used with a custom package_config.json, so don't validate
6+
// the imports against the pubspec.yaml.
7+
// @skip_package_deps_validation
8+
59
import 'dart:core';
610

711
import 'package:const_finder_fixtures_package/package.dart';

pkg/frontend_server/test/fixtures/lib/consts_and_non.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// This test is always used with a custom package_config.json, so don't validate
6+
// the imports against the pubspec.yaml.
7+
// @skip_package_deps_validation
8+
59
import 'dart:core';
610

711
import 'package:const_finder_fixtures_package/package.dart';

pkg/frontend_server/test/fixtures/pkg/package.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// This test is always used with a custom package_config.json, so don't validate
6+
// the imports against the pubspec.yaml.
7+
// @skip_package_deps_validation
8+
59
import 'package:const_finder_fixtures/target.dart';
610

711
void createTargetInPackage() {

tools/package_deps/bin/package_deps.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ class Package implements Comparable<Package> {
371371

372372
for (var line in file.readAsLinesSync()) {
373373
// Check for a few tokens that should stop our parse.
374-
if (line.startsWith('class ') ||
374+
if (line.startsWith('// @skip_package_deps_validation') ||
375+
line.startsWith('class ') ||
375376
line.startsWith('typedef ') ||
376377
line.startsWith('mixin ') ||
377378
line.startsWith('enum ') ||

0 commit comments

Comments
 (0)