Skip to content

Commit 82f2b3b

Browse files
dnfieldEgor
authored andcommitted
Fix sharding and shard count on apk tests (flutter#2936)
* Use shard variables correctly in incremental_build.sh * Add more shards for the apk tasks.
1 parent 859b0d6 commit 82f2b3b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.cirrus.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ task:
6363
- name: build-apks+java-test+firebase-test-lab
6464
env:
6565
matrix:
66-
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
67-
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
66+
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
67+
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
68+
PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4"
69+
PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4"
6870
matrix:
6971
CHANNEL: "master"
7072
CHANNEL: "stable"

script/incremental_build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,25 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then
2929
fi
3030

3131
BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}"
32+
33+
# This has to be turned into a list and then split out to the command line,
34+
# otherwise it gets treated as a single argument.
35+
PLUGIN_SHARDING=($PLUGIN_SHARDING)
36+
3237
if [[ "${BRANCH_NAME}" == "master" ]]; then
3338
echo "Running for all packages"
34-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING)
39+
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
3540
else
3641
# Sets CHANGED_PACKAGES
3742
check_changed_packages
3843

3944
if [[ "$CHANGED_PACKAGES" == "" ]]; then
4045
echo "No changes detected in packages."
4146
echo "Running for all packages"
42-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING)
47+
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
4348
else
4449
echo running "${ACTIONS[@]}"
45-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING)
50+
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]})
4651
echo "Running version check for changed packages"
4752
(cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")
4853
fi

0 commit comments

Comments
 (0)