[tool] Support --flavor option for flutter install. (#114048)
* Alphabetize setup calls * Add --flavor as an option for install * Add verbose logging in install command * Test that flavors build succeeds with proper flavor and fails with bogus one. * Remove unused import * The import was used... * SQUASH * Add flavor install test * Rename test * Add flavors install integration tests * correct error message * remove unused imports * Delete copy test * update test target * Refactor mechanism to read buildInfo * Remove unused import * Set affected test targets to bringup: true Co-authored-by: a-wallen <stephenwallen@google.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import 'package:flutter_devicelab/framework/devices.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
@@ -12,6 +13,30 @@ Future<void> main() async {
|
||||
await task(() async {
|
||||
await createFlavorsTest().call();
|
||||
await createIntegrationTestFlavorsTest().call();
|
||||
// test install and uninstall of flavors app
|
||||
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
|
||||
await flutter(
|
||||
'install',
|
||||
options: <String>['--flavor', 'paid'],
|
||||
);
|
||||
await flutter(
|
||||
'install',
|
||||
options: <String>['--flavor', 'paid', '--uninstall-only'],
|
||||
);
|
||||
final StringBuffer stderr = StringBuffer();
|
||||
await evalFlutter(
|
||||
'install',
|
||||
canFail: true,
|
||||
stderr: stderr,
|
||||
options: <String>['--flavor', 'bogus'],
|
||||
);
|
||||
|
||||
final String stderrString = stderr.toString();
|
||||
if (!stderrString.contains('The Xcode project defines schemes: free, paid')) {
|
||||
print(stderrString);
|
||||
return TaskResult.failure('Should not succeed with bogus flavor');
|
||||
}
|
||||
});
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:flutter_devicelab/framework/devices.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
@@ -12,6 +13,30 @@ Future<void> main() async {
|
||||
await task(() async {
|
||||
await createFlavorsTest().call();
|
||||
await createIntegrationTestFlavorsTest().call();
|
||||
// test install and uninstall of flavors app
|
||||
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
|
||||
await flutter(
|
||||
'install',
|
||||
options: <String>['--flavor', 'paid'],
|
||||
);
|
||||
await flutter(
|
||||
'install',
|
||||
options: <String>['--flavor', 'paid', '--uninstall-only'],
|
||||
);
|
||||
final StringBuffer stderr = StringBuffer();
|
||||
await evalFlutter(
|
||||
'install',
|
||||
canFail: true,
|
||||
stderr: stderr,
|
||||
options: <String>['--flavor', 'bogus'],
|
||||
);
|
||||
|
||||
final String stderrString = stderr.toString();
|
||||
if (!stderrString.contains('install failed, bogus flavor not found')) {
|
||||
print(stderrString);
|
||||
return TaskResult.failure('Should not succeed with bogus flavor');
|
||||
}
|
||||
});
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_devicelab/framework/devices.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() async {
|
||||
await createFlavorsTest().call();
|
||||
await createIntegrationTestFlavorsTest().call();
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user