Re-enable engine dependency proxy test. (#115511)
Re-enable engine dependency proxy test.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_devicelab/framework/apk_utils.dart';
|
||||
@@ -29,7 +30,7 @@ Future<void> main() async {
|
||||
await inDirectory(path.join(flutterProject.rootPath, 'android'), () async {
|
||||
section('Insert gradle testing script');
|
||||
final File build = File(path.join(
|
||||
flutterProject.rootPath, 'android', 'app', 'build.gradle'));
|
||||
flutterProject.rootPath, 'android', 'app', 'build.gradle'));
|
||||
build.writeAsStringSync(
|
||||
'''
|
||||
task printEngineMavenUrl() {
|
||||
@@ -43,31 +44,38 @@ task printEngineMavenUrl() {
|
||||
);
|
||||
|
||||
section('Checking default maven URL');
|
||||
String mavenUrl = await eval(
|
||||
String gradleOutput = await eval(
|
||||
gradlewExecutable,
|
||||
<String>['printEngineMavenUrl', '-q'],
|
||||
);
|
||||
const LineSplitter splitter = LineSplitter();
|
||||
List<String> outputLines = splitter.convert(gradleOutput);
|
||||
String mavenUrl = outputLines.last;
|
||||
print('Returned maven url: $mavenUrl');
|
||||
|
||||
if (mavenUrl != 'https://storage.googleapis.com/download.flutter.io') {
|
||||
throw TaskResult.failure('Expected Android engine maven dependency URL to '
|
||||
'resolve to https://storage.googleapis.com/download.flutter.io. Got '
|
||||
'$mavenUrl instead');
|
||||
'resolve to https://storage.googleapis.com/download.flutter.io. Got '
|
||||
'$mavenUrl instead');
|
||||
}
|
||||
|
||||
section('Checking overridden maven URL');
|
||||
mavenUrl = await eval(
|
||||
gradlewExecutable,
|
||||
<String>['printEngineMavenUrl', '-q'],
|
||||
environment: <String, String>{
|
||||
'FLUTTER_STORAGE_BASE_URL': 'https://my.special.proxy',
|
||||
}
|
||||
);
|
||||
gradleOutput = await eval(
|
||||
gradlewExecutable,
|
||||
<String>['printEngineMavenUrl','-q'],
|
||||
environment: <String, String>{
|
||||
'FLUTTER_STORAGE_BASE_URL': 'https://my.special.proxy',
|
||||
}
|
||||
);
|
||||
outputLines = splitter.convert(gradleOutput);
|
||||
mavenUrl = outputLines.last;
|
||||
|
||||
if (mavenUrl != 'https://my.special.proxy/download.flutter.io') {
|
||||
throw TaskResult.failure('Expected overridden Android engine maven '
|
||||
'dependency URL to resolve to proxy location '
|
||||
'https://my.special.proxy/download.flutter.io. Got '
|
||||
'$mavenUrl instead');
|
||||
throw TaskResult.failure(
|
||||
'Expected overridden Android engine maven '
|
||||
'dependency URL to resolve to proxy location '
|
||||
'https://my.special.proxy/download.flutter.io. Got '
|
||||
'$mavenUrl instead');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user