Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Enable Mac ios_platform_tests tests #6682

Merged
merged 7 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,99 @@ targets:
target_file: mac_build_all_plugins.yaml
channel: stable

### iOS tasks ###
# TODO(stuartmorgan): Swap this and ios-build_all_plugins once simulator
# tests are reliable on the ARM infrastructure. See discussion at
# https://github.com/flutter/plugins/pull/5693#issuecomment-1126011089
- name: Mac_x64 ios_platform_tests_1_of_4 master
recipe: plugins/plugins
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
add_recipes_cq: "true"
version_file: flutter_master.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 0 --shardCount 4"

- name: Mac_x64 ios_platform_tests_2_of_4 master
recipe: plugins/plugins
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
add_recipes_cq: "true"
version_file: flutter_master.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 1 --shardCount 4"

- name: Mac_x64 ios_platform_tests_3_of_4 master
recipe: plugins/plugins
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
add_recipes_cq: "true"
version_file: flutter_master.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 2 --shardCount 4"

- name: Mac_x64 ios_platform_tests_4_of_4 master
recipe: plugins/plugins
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
add_recipes_cq: "true"
version_file: flutter_master.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 3 --shardCount 4"

# Don't run full platform tests on both channels in pre-submit.
- name: Mac_x64 ios_platform_tests_1_of_4 stable
recipe: plugins/plugins
presubmit: false
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
channel: stable
add_recipes_cq: "true"
version_file: flutter_stable.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 0 --shardCount 4"

- name: Mac_x64 ios_platform_tests_2_of_4 stable
recipe: plugins/plugins
presubmit: false
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
channel: stable
add_recipes_cq: "true"
version_file: flutter_stable.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 1 --shardCount 4"

- name: Mac_x64 ios_platform_tests_3_of_4 stable
recipe: plugins/plugins
presubmit: false
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
channel: stable
add_recipes_cq: "true"
version_file: flutter_stable.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 2 --shardCount 4"

- name: Mac_x64 ios_platform_tests_4_of_4 stable
recipe: plugins/plugins
presubmit: false
bringup: true # New target: https://github.com/flutter/plugins/pull/6682
timeout: 30
properties:
channel: stable
add_recipes_cq: "true"
version_file: flutter_stable.version
target_file: mac_ios_platform_tests.yaml
package_sharding: "--shardIndex 3 --shardCount 4"

- name: Windows win32-platform_tests master
recipe: plugins/plugins
timeout: 30
Expand Down
10 changes: 10 additions & 0 deletions .ci/scripts/create_simulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Copyright 2013 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.

device=com.apple.CoreSimulator.SimDeviceType.iPhone-11
os=com.apple.CoreSimulator.SimRuntime.iOS-16-0

xcrun simctl list
xcrun simctl create Flutter-iPhone "$device" "$os" | xargs xcrun simctl boot
22 changes: 22 additions & 0 deletions .ci/targets/mac_ios_platform_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
tasks:
- name: create simulator
script: .ci/scripts/create_simulator.sh
- name: build examples
script: script/tool_runner.sh
args: ["build-examples", "--ios"]
- name: xcode analyze
script: script/tool_runner.sh
args: ["xcode-analyze", "--ios"]
- name: xcode analyze deprecation
# Ensure we don't accidentally introduce deprecated code.
script: script/tool_runner.sh
args: ["xcode-analyze", "--ios", "--ios-min-version=13.0"]
- name: native test
script: script/tool_runner.sh
args: ["native-test", "--ios", "--ios-destination", "platform=iOS Simulator,name=iPhone 11,OS=latest"]
- name: drive examples
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
script: script/tool_runner.sh
args: ["drive-examples", "--ios", "--exclude=script/configs/exclude_integration_ios.yaml"]