Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 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: Max_x64 ios_platform_tests_0_4 master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the clarify of "index" and "count" being in the name, I think it would be clear to 1-index them and add an "of". I.e., ios_platform_tests_1_of_4 through ios_platform_tests_4_of_4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any plan to building matricies into Cocoon? Having to specify each of these explicitly is much more verbose and error prone than the Cirrus matrix spec. It would also be a huge pain to change the sharding (which we do occasionally) since instead of being able to do a single PR—including the ability to iterate in presubmit to see what the best number of shards is, which is usually what we have done in the past—we'll need to add a whole duplicate set in bringup, land them, see how they go, iterate in post-submit with new PRs if necessary, and then finally do a last PR to switch over.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A generic builder will do the trick. It has been planned for release branches (flutter/flutter#97265), and we can do the same for main/master.
But currently it is blocked on LUCI team implementing the support API. Once that's unblocked, we should be able to use cocoon do the scheduling.

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: Max_x64 ios_platform_tests_1_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: Max_x64 ios_platform_tests_2_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: Max_x64 ios_platform_tests_3_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: Max_x64 ios_platform_tests_0_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: Max_x64 ios_platform_tests_1_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: Max_x64 ios_platform_tests_2_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: Max_x64 ios_platform_tests_3_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
7 changes: 7 additions & 0 deletions .ci/scripts/create_simulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/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.

xcrun simctl list
xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-16-0 | xargs xcrun simctl boot
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use iOS-16-0, which is the default runtime with current xcode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a mini-script, I think it would be nice to pull out the device and OS into variables so each is on their own line instead of one massive line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG. Updated the script.

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"]