Test flutter create --offline (#23278)
Verifies that flutter tools isn't rebuilt. Doesn't truly check that the created output is runnable.
This commit is contained in:
committed by
GitHub
parent
0edbe726a1
commit
43c99404c5
@@ -0,0 +1,6 @@
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(createFlutterCreateOfflineTest());
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(createFlutterCreateOfflineTest());
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(createFlutterCreateOfflineTest());
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
import '../framework/adb.dart';
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/ios.dart';
|
||||
@@ -59,6 +61,22 @@ TaskFunction createAndroidSemanticsIntegrationTest() {
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createFlutterCreateOfflineTest() {
|
||||
return () async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_create_test.');
|
||||
String output;
|
||||
await inDirectory(tempDir, () async {
|
||||
output = await eval(path.join(flutterDirectory.path, 'bin', 'flutter'), <String>['create', '--offline', 'flutter_create_test']);
|
||||
});
|
||||
if (output.contains(RegExp('building flutter tool', caseSensitive: false))) {
|
||||
return TaskResult.failure('`flutter create --offline` should not rebuild flutter tool');
|
||||
} else if (!output.contains('All done!')) {
|
||||
return TaskResult.failure('`flutter create` failed');
|
||||
}
|
||||
return TaskResult.success(null);
|
||||
};
|
||||
}
|
||||
|
||||
class DriverTest {
|
||||
|
||||
DriverTest(
|
||||
|
||||
@@ -283,6 +283,27 @@ tasks:
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["linux/android"]
|
||||
|
||||
flutter_create_offline_test_linux:
|
||||
description: >
|
||||
Tests the `flutter create --offline` command.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["linux/android"]
|
||||
flaky: true
|
||||
|
||||
flutter_create_offline_test_windows:
|
||||
description: >
|
||||
Tests the `flutter create --offline` command.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["windows/android"]
|
||||
flaky: true
|
||||
|
||||
flutter_create_offline_test_mac:
|
||||
description: >
|
||||
Tests the `flutter create --offline` command.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["mac/android"]
|
||||
flaky: true
|
||||
|
||||
# iOS on-device tests
|
||||
|
||||
flavors_test_ios:
|
||||
|
||||
Reference in New Issue
Block a user