Skip to content

Commit 900c7c1

Browse files
authored
Optimize fuchsia test script. (flutter#55401)
1 parent e74fedc commit 900c7c1

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

dev/bots/run_fuchsia_tests.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
#
1616
# This script expects `pm`, `device-finder`, and `fuchsia_ctl` to all be in the
1717
# same directory as the script.
18+
#
19+
# This script also expects a private key available at:
20+
# "/etc/botanist/keys/id_rsa_infra".
1821

1922
set -Eex
2023

2124
script_dir=$(dirname "$(readlink -f "$0")")
2225

26+
# Bot key to pave and ssh the device.
27+
pkey="/etc/botanist/keys/id_rsa_infra"
28+
2329
# The nodes are named blah-blah--four-word-fuchsia-id
2430
device_name=${SWARMING_BOT_ID#*--}
2531

@@ -33,16 +39,22 @@ fi
3339

3440
reboot() {
3541
# note: this will set an exit code of 255, which we can ignore.
36-
$script_dir/fuchsia_ctl -d $device_name --dev-finder-path $script_dir/dev_finder ssh --identity-file $script_dir/.ssh/pkey -c "dm reboot-recovery" || true
42+
echo "$(date) START:REBOOT ------------------------------------------"
43+
$script_dir/fuchsia_ctl -d $device_name --dev-finder-path $script_dir/dev_finder ssh --identity-file $pkey -c "dm reboot-recovery" || true
44+
echo "$(date) END:REBOOT --------------------------------------------"
3745
}
3846

3947
trap reboot EXIT
4048

41-
$script_dir/fuchsia_ctl -d $device_name pave -i $1
42-
$script_dir/fuchsia_ctl push-packages -d $device_name --repoArchive generic-x64.tar.gz -p tiles -p tiles_ctl
49+
echo "$(date) START:PAVING ------------------------------------------"
50+
ssh-keygen -y -f $pkey > key.pub
51+
$script_dir/fuchsia_ctl -d $device_name pave -i $1 --public-key "key.pub"
52+
echo "$(date) END:PAVING --------------------------------------------"
53+
54+
55+
$script_dir/fuchsia_ctl push-packages -d $device_name --identity-file $pkey --repoArchive generic-x64.tar.gz -p tiles -p tiles_ctl
4356

4457
# set fuchsia ssh config
45-
export FUCHSIA_SSH_PKEY=$script_dir/.ssh/pkey
4658
cat > $script_dir/fuchsia_ssh_config << EOF
4759
Host *
4860
CheckHostIP no
@@ -53,7 +65,7 @@ Host *
5365
UserKnownHostsFile /dev/null
5466
User fuchsia
5567
IdentitiesOnly yes
56-
IdentityFile $FUCHSIA_SSH_PKEY
68+
IdentityFile $pkey
5769
ControlPersist yes
5870
ControlMaster auto
5971
ControlPath /tmp/fuchsia--%r@%h:%p
@@ -66,13 +78,13 @@ EOF
6678
export FUCHSIA_SSH_CONFIG=$script_dir/fuchsia_ssh_config
6779

6880
# Run the driver test
81+
echo "$(date) START:DRIVER_TEST -------------------------------------"
6982
flutter_dir=$script_dir/flutter
7083
flutter_bin=$flutter_dir/bin/flutter
7184

7285
# remove all out dated .packages references
7386
find $flutter_dir -name ".packages" | xargs rm
74-
7587
cd $flutter_dir/dev/benchmarks/test_apps/stocks/
76-
7788
$flutter_bin pub get
7889
$flutter_bin drive -v -d $device_name --target=test_driver/stock_view.dart
90+
echo "$(date) END:DRIVER_TEST ---------------------------------------"

0 commit comments

Comments
 (0)