Unverified Commit 697928d2 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Revert "Set up iOS native integration_tests in ui example project (#84596)" (#84641)

This reverts commit ef2879a4.
parent db930ba3
...@@ -4,11 +4,14 @@ ...@@ -4,11 +4,14 @@
// @dart = 2.8 // @dart = 2.8
import 'dart:io';
import 'package:flutter_devicelab/framework/devices.dart'; import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart'; import 'package:flutter_devicelab/framework/host_agent.dart';
import 'package:flutter_devicelab/framework/task_result.dart'; import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart'; import 'package:flutter_devicelab/framework/utils.dart';
import 'package:path/path.dart' as path;
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios; deviceOperatingSystem = DeviceOperatingSystem.ios;
...@@ -35,8 +38,59 @@ Future<void> main() async { ...@@ -35,8 +38,59 @@ Future<void> main() async {
}); });
section('Run platform unit tests'); section('Run platform unit tests');
final Device device = await devices.workingDevice; final Device device = await devices.workingDevice;
await runNativeIosXcodeTests(device, projectDirectory); final Map<String, String> environment = Platform.environment;
// If not running on CI, inject the Flutter team code signing properties.
final String developmentTeam = environment['FLUTTER_XCODE_DEVELOPMENT_TEAM'] ?? 'S8QB4VV633';
final String codeSignStyle = environment['FLUTTER_XCODE_CODE_SIGN_STYLE'];
final String provisioningProfile = environment['FLUTTER_XCODE_PROVISIONING_PROFILE_SPECIFIER'];
final String resultBundleTemp = Directory.systemTemp.createTempSync('flutter_native_ui_tests_ios32_xcresult.').path;
final String resultBundlePath = path.join(resultBundleTemp, 'result');
final int testResultExit = await exec(
'xcodebuild',
<String>[
'-workspace',
'Runner.xcworkspace',
'-scheme',
'Runner',
'-configuration',
'Release',
'-destination',
'id=${device.deviceId}',
'-resultBundlePath',
resultBundlePath,
'test',
'COMPILER_INDEX_STORE_ENABLE=NO',
'DEVELOPMENT_TEAM=$developmentTeam',
if (codeSignStyle != null)
'CODE_SIGN_STYLE=$codeSignStyle',
if (provisioningProfile != null)
'PROVISIONING_PROFILE_SPECIFIER=$provisioningProfile',
],
workingDirectory: path.join(projectDirectory, 'ios'),
canFail: true,
);
if (testResultExit != 0) {
// Zip the test results to the artifacts directory for upload.
final String zipPath = path.join(hostAgent.dumpDirectory.path,
'native_ui_tests_ios32-${DateTime.now().toLocal().toIso8601String()}.zip');
await exec(
'zip',
<String>[
'-r',
'-9',
zipPath,
'result.xcresult',
],
workingDirectory: resultBundleTemp,
canFail: true, // Best effort to get the logs.
);
return TaskResult.failure('Platform unit tests failed');
}
return TaskResult.success(null); return TaskResult.success(null);
}); });
......
...@@ -879,8 +879,8 @@ class IosDevice extends Device { ...@@ -879,8 +879,8 @@ class IosDevice extends Device {
Future<void> stopLoggingToSink() async { Future<void> stopLoggingToSink() async {
assert(_loggingProcess != null); assert(_loggingProcess != null);
_abortedLogging = true; _abortedLogging = true;
_loggingProcess?.kill(); _loggingProcess.kill();
await _loggingProcess?.exitCode; await _loggingProcess.exitCode;
} }
// The methods below are stubs for now. They will need to be expanded. // The methods below are stubs for now. They will need to be expanded.
......
...@@ -161,8 +161,9 @@ class _TaskRunner { ...@@ -161,8 +161,9 @@ class _TaskRunner {
result = await futureResult; result = await futureResult;
} finally { } finally {
if (device != null && device.canStreamLogs) { if (device != null && device.canStreamLogs) {
assert(sink != null);
await device.stopLoggingToSink(); await device.stopLoggingToSink();
await sink?.close(); await sink.close();
} }
} }
......
...@@ -5,13 +5,7 @@ ...@@ -5,13 +5,7 @@
// @dart = 2.8 // @dart = 2.8
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
import 'devices.dart';
import 'host_agent.dart';
import 'task_result.dart';
import 'utils.dart'; import 'utils.dart';
typedef SimulatorFunction = Future<void> Function(String deviceId); typedef SimulatorFunction = Future<void> Function(String deviceId);
...@@ -150,57 +144,3 @@ Future<void> removeIOSimulator(String deviceId) async { ...@@ -150,57 +144,3 @@ Future<void> removeIOSimulator(String deviceId) async {
); );
} }
} }
Future<void> runNativeIosXcodeTests(Device device, String projectDirectory) async {
final Map<String, String> environment = Platform.environment;
// If not running on CI, inject the Flutter team code signing properties.
final String developmentTeam = environment['FLUTTER_XCODE_DEVELOPMENT_TEAM'] ?? 'S8QB4VV633';
final String codeSignStyle = environment['FLUTTER_XCODE_CODE_SIGN_STYLE'];
final String provisioningProfile = environment['FLUTTER_XCODE_PROVISIONING_PROFILE_SPECIFIER'];
final String resultBundleTemp = Directory.systemTemp.createTempSync('flutter_native_ios_tests_xcresult.').path;
final String resultBundlePath = path.join(resultBundleTemp, 'result');
final int testResultExit = await exec(
'xcodebuild',
<String>[
'-workspace',
'Runner.xcworkspace',
'-scheme',
'Runner',
'-configuration',
'Release',
'-destination',
'id=${device.deviceId}',
'-resultBundlePath',
resultBundlePath,
'test',
'COMPILER_INDEX_STORE_ENABLE=NO',
'DEVELOPMENT_TEAM=$developmentTeam',
if (codeSignStyle != null) 'CODE_SIGN_STYLE=$codeSignStyle',
if (provisioningProfile != null) 'PROVISIONING_PROFILE_SPECIFIER=$provisioningProfile',
],
workingDirectory: path.join(projectDirectory, 'ios'),
canFail: true,
);
if (testResultExit != 0) {
if (hostAgent.dumpDirectory != null) {
// Zip the test results to the artifacts directory for upload.
final String zipPath = path.join(
hostAgent.dumpDirectory.path, 'xcode_test_results_-${DateTime.now().toLocal().toIso8601String()}.zip');
await exec(
'zip',
<String>[
'-r',
'-9',
zipPath,
'result.xcresult',
],
workingDirectory: resultBundleTemp,
canFail: true, // Best effort to get the logs.
);
}
throw TaskResult.failure('Xcode iOS unit tests failed');
}
}
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import '../framework/devices.dart'; import '../framework/devices.dart';
import '../framework/framework.dart'; import '../framework/framework.dart';
import '../framework/host_agent.dart'; import '../framework/host_agent.dart';
import '../framework/ios.dart';
import '../framework/task_result.dart'; import '../framework/task_result.dart';
import '../framework/utils.dart'; import '../framework/utils.dart';
...@@ -194,19 +193,6 @@ class IntegrationTest { ...@@ -194,19 +193,6 @@ class IntegrationTest {
]; ];
await flutter('test', options: options); await flutter('test', options: options);
if (device is IosDevice) {
section('Run integration_test from Xcode');
final List<String> options = <String>[
'ios',
'--config-only',
testTarget,
];
await flutter('build', options: options);
await runNativeIosXcodeTests(device, testDirectory);
}
return TaskResult.success(null); return TaskResult.success(null);
}); });
} }
......
...@@ -3,13 +3,10 @@ ...@@ -3,13 +3,10 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:integration_ui/build_mode.dart' as app; import 'package:integration_ui/build_mode.dart' as app;
void main() { void main() {
group('Integration Test', () { group('Integration Test', () {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('smoke test', (WidgetTester tester) async { testWidgets('smoke test', (WidgetTester tester) async {
app.main(); app.main();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
......
...@@ -29,10 +29,6 @@ flutter_ios_podfile_setup ...@@ -29,10 +29,6 @@ flutter_ios_podfile_setup
target 'Runner' do target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end end
post_install do |installer| post_install do |installer|
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
...@@ -36,18 +38,8 @@ ...@@ -36,18 +38,8 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<Testables> <AdditionalOptions>
<TestableReference </AdditionalOptions>
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F708CDE82677EA0F00ABB9ED"
BuildableName = "RunnerTests.xctest"
BlueprintName = "RunnerTests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
...@@ -69,6 +61,8 @@ ...@@ -69,6 +61,8 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Profile" buildConfiguration = "Profile"
......
...@@ -4,7 +4,4 @@ ...@@ -4,7 +4,4 @@
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "group:Runner.xcodeproj">
</FileRef> </FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace> </Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
// 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 XCTest;
@import integration_test;
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment