From 474e90ba76882ad63eb5ec451232b51ab4c8c627 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 1 Apr 2020 18:46:04 -0700 Subject: [PATCH] Add build_and_test_linux_release presubmit test (flutter/engine#17073) --- engine/src/flutter/.cirrus.yml | 10 ++++++++++ .../flutter_frontend_server/test/to_string_test.dart | 6 +++++- engine/src/flutter/shell/common/shell_unittests.cc | 12 +++++------- engine/src/flutter/testing/run_tests.py | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/.cirrus.yml b/engine/src/flutter/.cirrus.yml index 88f3c3e713..b2942ded3b 100644 --- a/engine/src/flutter/.cirrus.yml +++ b/engine/src/flutter/.cirrus.yml @@ -60,10 +60,20 @@ task: cd $ENGINE_PATH/src/out/host_release/ ./txt_benchmarks --benchmark_format=json > txt_benchmarks.json ./fml_benchmarks --benchmark_format=json > fml_benchmarks.json + ./fml_benchmarks --benchmark_format=json > shell_benchmarks.json cd $ENGINE_PATH/src/flutter/testing/benchmark pub get dart bin/parse_and_send.dart ../../../out/host_release/txt_benchmarks.json dart bin/parse_and_send.dart ../../../out/host_release/fml_benchmarks.json + dart bin/parse_and_send.dart ../../../out/host_release/shell_benchmarks.json + - name: build_and_test_linux_release + compile_host_script: | + cd $ENGINE_PATH/src + ./flutter/tools/gn --runtime-mode=release + ninja -C out/host_release + test_host_script: | + cd $ENGINE_PATH/src + ./flutter/testing/run_tests.sh host_release - name: build_and_test_linux_unopt_debug compile_host_script: | cd $ENGINE_PATH/src diff --git a/engine/src/flutter/flutter_frontend_server/test/to_string_test.dart b/engine/src/flutter/flutter_frontend_server/test/to_string_test.dart index 3ee7570973..406d595716 100644 --- a/engine/src/flutter/flutter_frontend_server/test/to_string_test.dart +++ b/engine/src/flutter/flutter_frontend_server/test/to_string_test.dart @@ -270,9 +270,13 @@ void main(List args) async { ])); final ProcessResult runResult = Process.runSync(dart, [regularDill]); _checkProcessResult(runResult); + String paintString = '"Paint.toString":"Paint(Color(0xffffffff))"'; + if (const bool.fromEnvironment('dart.vm.product', defaultValue: false)) { + paintString = '"Paint.toString":"Instance of \'Paint\'"'; + } expect( runResult.stdout.trim(), - '{"Paint.toString":"Paint(Color(0xffffffff))",' + '{$paintString,' '"Brightness.toString":"Brightness.dark",' '"Foo.toString":"I am a Foo",' '"Keep.toString":"I am a Keep"}', diff --git a/engine/src/flutter/shell/common/shell_unittests.cc b/engine/src/flutter/shell/common/shell_unittests.cc index 8a7bd5d51d..c9c1345541 100644 --- a/engine/src/flutter/shell/common/shell_unittests.cc +++ b/engine/src/flutter/shell/common/shell_unittests.cc @@ -270,21 +270,19 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { fml::CommandLine::Option("dart-flags", "--verify_after_gc")}; fml::CommandLine command_line("", options, std::vector()); -#if !FLUTTER_RELEASE // Upon encountering a non-whitelisted Dart flag the process terminates. const char* expected = "Encountered blacklisted Dart VM flag: --verify_after_gc"; ASSERT_DEATH(flutter::SettingsFromCommandLine(command_line), expected); -#else - flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); - EXPECT_EQ(settings.dart_flags.size(), 0u); -#endif } TEST_F(ShellTest, WhitelistedDartVMFlag) { const std::vector options = { - fml::CommandLine::Option("dart-flags", - "--max_profile_depth 1,--random_seed 42")}; +#if !FLUTTER_RELEASE + fml::CommandLine::Option("dart-flags", + "--max_profile_depth 1,--random_seed 42") +#endif + }; fml::CommandLine command_line("", options, std::vector()); flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 083117458d..68abca30b3 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -409,7 +409,7 @@ def main(): if 'benchmarks' in types and not IsWindows(): RunEngineBenchmarks(build_dir, engine_filter) - if 'engine' in types or 'font-subset' in types: + if ('engine' in types or 'font-subset' in types) and args.variant != 'host_release': RunCmd(['python', 'test.py'], cwd=font_subset_dir)