Skip to content

Commit dcf789f

Browse files
authored
[ci] Cumulative fixes to reopen the tree. (#8344)
This PR fixes a couple of issues that have popped up in the CI of the tree in the last couple of days: 1. Disables some Android video_player tests that require network access. 2. Fixes our internal tool after a breaking change was made in an upstream dependency. ## Issues * Mitigates flutter/flutter#160797 * Fixes flutter/flutter#160799
1 parent 3515aba commit dcf789f

8 files changed

+34
-16
lines changed

packages/video_player/video_player/example/integration_test/video_player_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ void main() {
5656
testWidgets(
5757
'live stream duration != 0',
5858
(WidgetTester tester) async {
59+
// This test requires network access, and won't pass until a LUCI recipe
60+
// change is made.
61+
// TODO(camsim99): Remove once https://github.com/flutter/flutter/issues/160797 is fixed.
62+
if (!kIsWeb && Platform.isAndroid) {
63+
markTestSkipped(
64+
'Skipping due to https://github.com/flutter/flutter/issues/160797');
65+
return;
66+
}
67+
5968
final VideoPlayerController networkController =
6069
VideoPlayerController.networkUrl(
6170
Uri.parse(
@@ -266,6 +275,15 @@ void main() {
266275
testWidgets(
267276
'reports buffering status',
268277
(WidgetTester tester) async {
278+
// This test requires network access, and won't pass until a LUCI recipe
279+
// change is made.
280+
// TODO(camsim99): Remove once https://github.com/flutter/flutter/issues/160797 is fixed.
281+
if (!kIsWeb && Platform.isAndroid) {
282+
markTestSkipped(
283+
'Skipping due to https://github.com/flutter/flutter/issues/160797');
284+
return;
285+
}
286+
269287
await controller.initialize();
270288
// Mute to allow playing without DOM interaction on Web.
271289
// See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

script/tool/lib/src/common/package_looping_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
340340
if (minFlutterVersion != null) {
341341
final Pubspec pubspec = package.parsePubspec();
342342
final VersionConstraint? flutterConstraint =
343-
pubspec.environment?['flutter'];
343+
pubspec.environment['flutter'];
344344
if (flutterConstraint != null &&
345345
!flutterConstraint.allows(minFlutterVersion)) {
346346
return PackageResult.skip(
@@ -350,7 +350,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
350350

351351
if (minDartVersion != null) {
352352
final Pubspec pubspec = package.parsePubspec();
353-
final VersionConstraint? dartConstraint = pubspec.environment?['sdk'];
353+
final VersionConstraint? dartConstraint = pubspec.environment['sdk'];
354354
if (dartConstraint != null && !dartConstraint.allows(minDartVersion)) {
355355
return PackageResult.skip('Does not support Dart $minDartVersion');
356356
}

script/tool/lib/src/create_all_packages_app_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ dependencies {}
277277
final Pubspec originalPubspec = app.parsePubspec();
278278
const String dartSdkKey = 'sdk';
279279
final VersionConstraint dartSdkConstraint =
280-
originalPubspec.environment?[dartSdkKey] ??
280+
originalPubspec.environment[dartSdkKey] ??
281281
VersionConstraint.compatibleWith(
282282
Version.parse('3.0.0'),
283283
);
@@ -342,7 +342,7 @@ publish_to: none
342342
343343
version: ${pubspec.version}
344344
345-
environment:${_pubspecMapString(pubspec.environment!)}
345+
environment:${_pubspecMapString(pubspec.environment)}
346346
347347
dependencies:${_pubspecMapString(pubspec.dependencies)}
348348

script/tool/lib/src/pubspec_check_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ class PubspecCheckCommand extends PackageLoopingCommand {
488488
}
489489

490490
final Version? dartConstraintMin =
491-
_minimumForConstraint(pubspec.environment?['sdk']);
491+
_minimumForConstraint(pubspec.environment['sdk']);
492492
final Version? flutterConstraintMin =
493-
_minimumForConstraint(pubspec.environment?['flutter']);
493+
_minimumForConstraint(pubspec.environment['flutter']);
494494

495495
// Validate the Flutter constraint, if any.
496496
if (flutterConstraintMin != null && minMinFlutterVersion != null) {

script/tool/lib/src/update_min_sdk_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class UpdateMinSdkCommand extends PackageLoopingCommand {
8787
/// Returns the given "environment" section's [key] constraint as a range,
8888
/// if the key is present and has a range.
8989
VersionRange? _sdkRange(Pubspec pubspec, String key) {
90-
final VersionConstraint? constraint = pubspec.environment?[key];
90+
final VersionConstraint? constraint = pubspec.environment[key];
9191
if (constraint is VersionRange) {
9292
return constraint;
9393
}

script/tool/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
path: ^1.8.3
1818
platform: ^3.0.2
1919
pub_semver: ^2.0.0
20-
pubspec_parse: ^1.2.2
20+
pubspec_parse: ^1.4.0
2121
quiver: ^3.0.1
2222
test: ^1.24.0
2323
uuid: ^4.5.1

script/tool/test/create_all_packages_app_command_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ android {
356356
final Pubspec generatedPubspec = command.app.parsePubspec();
357357

358358
const String dartSdkKey = 'sdk';
359-
expect(generatedPubspec.environment?[dartSdkKey].toString(),
359+
expect(generatedPubspec.environment[dartSdkKey].toString(),
360360
existingSdkConstraint);
361361
});
362362

script/tool/test/update_min_sdk_command_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main() {
5050
]);
5151

5252
final String dartVersion =
53-
package.parsePubspec().environment?['sdk'].toString() ?? '';
53+
package.parsePubspec().environment['sdk'].toString();
5454
expect(dartVersion, '^3.1.0');
5555
});
5656

@@ -65,7 +65,7 @@ void main() {
6565
]);
6666

6767
final String dartVersion =
68-
package.parsePubspec().environment?['sdk'].toString() ?? '';
68+
package.parsePubspec().environment['sdk'].toString();
6969
expect(dartVersion, '^3.1.0');
7070
});
7171

@@ -80,7 +80,7 @@ void main() {
8080
]);
8181

8282
final String dartVersion =
83-
package.parsePubspec().environment?['sdk'].toString() ?? '';
83+
package.parsePubspec().environment['sdk'].toString();
8484
expect(dartVersion, '^3.2.0');
8585
});
8686

@@ -98,9 +98,9 @@ void main() {
9898
]);
9999

100100
final String dartVersion =
101-
package.parsePubspec().environment?['sdk'].toString() ?? '';
101+
package.parsePubspec().environment['sdk'].toString();
102102
final String flutterVersion =
103-
package.parsePubspec().environment?['flutter'].toString() ?? '';
103+
package.parsePubspec().environment['flutter'].toString();
104104
expect(dartVersion, '^3.1.0');
105105
expect(flutterVersion, '>=3.13.0');
106106
});
@@ -119,9 +119,9 @@ void main() {
119119
]);
120120

121121
final String dartVersion =
122-
package.parsePubspec().environment?['sdk'].toString() ?? '';
122+
package.parsePubspec().environment['sdk'].toString();
123123
final String flutterVersion =
124-
package.parsePubspec().environment?['flutter'].toString() ?? '';
124+
package.parsePubspec().environment['flutter'].toString();
125125
expect(dartVersion, '^3.2.0');
126126
expect(flutterVersion, '>=3.16.0');
127127
});

0 commit comments

Comments
 (0)