Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Fuchsia unit test runners into engine repo (#14092) #14287

Merged
merged 2 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 17 additions & 5 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ group("flutter") {
]
}
}

# Fuchsia currently only supports a subset of our unit tests
if (is_fuchsia) {
public_deps += [ "$flutter_root/fml:fml_tests" ]
}
}

config("config") {
Expand Down Expand Up @@ -124,3 +119,20 @@ group("dist") {
"$flutter_root/sky/dist",
]
}

# Fuchsia currently only supports a subset of our unit tests
# When adding a new dep here, please also ensure the dep is added to
# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars
if (is_fuchsia) {
group("fuchsia_tests") {
testonly = true

deps = [
"$flutter_root/flow:flow_tests",
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to remove this dep as this branch doesn't have the flow_tests added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


# TODO(gw280): Re-enable fml_tests on Fuchsia (https://github.com/flutter/flutter/issues/46122)
# "$flutter_root/fml:fml_tests",
"$flutter_root/shell/platform/fuchsia/flutter:flutter_runner_tests",
]
}
}
41 changes: 41 additions & 0 deletions testing/fuchsia/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# This expects the device to be in zedboot mode, with a zedboot that is
# is compatible with the Fuchsia system image provided.
#
# The first and only parameter should be the path to the Fuchsia system image
# tarball, e.g. `./fuchsia-test.sh generic-x64.tgz`.
#
# This script expects `pm`, `dev_finder`, and `fuchsia_ctl` to all be in the
# same directory as the script, as well as the `flutter_aot_runner-0.far` and
# the `flutter_runner_tests-0.far`. It is written to be run from its own
# directory, and will fail if run from other directories or via sym-links.

set -Ee

# The nodes are named blah-blah--four-word-fuchsia-id
device_name=${SWARMING_BOT_ID#*--}

if [ -z "$device_name" ]
then
echo "No device found. Aborting."
exit 1
else
echo "Connecting to device $device_name"
fi

reboot() {
# note: this will set an exit code of 255, which we can ignore.
./fuchsia_ctl -d $device_name ssh -c "dm reboot-recovery" || true
}

trap reboot EXIT

./fuchsia_ctl -d $device_name pave -i $1

# TODO(gw280): Enable tests using JIT runner
./fuchsia_ctl -d $device_name test \
-f flutter_aot_runner-0.far \
-f flutter_runner_tests-0.far \
-t flutter_runner_tests

1 change: 1 addition & 0 deletions testing/fuchsia/test_fars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flutter_runner_tests-0.far
2 changes: 1 addition & 1 deletion tools/fuchsia/fuchsia_archive.gni
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ template("fuchsia_archive") {
"$cmx_file",
]
outputs = [
"$far_base_dir/meta/{{source_file_part}}",
"$far_base_dir/meta/${pkg_target_name}.cmx",
]
}

Expand Down