From f1cb0535258ac70d5fdb2335c2f116e269a1b35e Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Tue, 10 Mar 2020 13:09:08 -0700 Subject: [PATCH 1/7] Add build_and_test_linux_release presubmit test Also enable shell_benchmarks in postsubmit release benchmarks. --- .cirrus.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 88f3c3e71319e..b2942ded3b186 100644 --- a/.cirrus.yml +++ b/.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 From ef4197ceb67eb11b4c564cb999c5a6e6cc20321b Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Tue, 10 Mar 2020 14:53:45 -0700 Subject: [PATCH 2/7] FML_LOG to FML_DLOG That's the intended behavior according to Ben. --- shell/common/switches.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 885763a107557..fb3fd6267701c 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -361,7 +361,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { // Assume that individual flags are comma separated. while (std::getline(stream, flag, ',')) { if (!IsWhitelistedDartVMFlag(flag)) { - FML_LOG(FATAL) << "Encountered blacklisted Dart VM flag: " << flag; + FML_DLOG(FATAL) << "Encountered blacklisted Dart VM flag: " << flag; } settings.dart_flags.push_back(flag); } From 4deb36300a5f193f6d58ca405b6520ae172ea42c Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Tue, 10 Mar 2020 15:17:48 -0700 Subject: [PATCH 3/7] Terminate on release Chinmay said terminate on release is the intended behavior. --- shell/common/shell_unittests.cc | 5 ----- shell/common/switches.cc | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index 8a7bd5d51dcea..f98d99c1c0aca 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -270,15 +270,10 @@ 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) { diff --git a/shell/common/switches.cc b/shell/common/switches.cc index fb3fd6267701c..885763a107557 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -361,7 +361,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { // Assume that individual flags are comma separated. while (std::getline(stream, flag, ',')) { if (!IsWhitelistedDartVMFlag(flag)) { - FML_DLOG(FATAL) << "Encountered blacklisted Dart VM flag: " << flag; + FML_LOG(FATAL) << "Encountered blacklisted Dart VM flag: " << flag; } settings.dart_flags.push_back(flag); } From e32798ba767c7fee4f5f00c3deb526c13073f574 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Mon, 30 Mar 2020 17:03:43 -0700 Subject: [PATCH 4/7] Also fix the whitelist unit test --- shell/common/shell_unittests.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index f98d99c1c0aca..11563a7736298 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -278,8 +278,11 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { TEST_F(ShellTest, WhitelistedDartVMFlag) { const std::vector options = { +#if !FLUTTER_RELEASE fml::CommandLine::Option("dart-flags", - "--max_profile_depth 1,--random_seed 42")}; + "--max_profile_depth 1,--random_seed 42") +#endif + }; fml::CommandLine command_line("", options, std::vector()); flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); From f4c0e3aed9f5d6fc5cee66a28e02558b595decd5 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Mon, 30 Mar 2020 21:00:21 -0700 Subject: [PATCH 5/7] format --- shell/common/shell_unittests.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index 11563a7736298..c9c1345541fcc 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -279,8 +279,8 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { TEST_F(ShellTest, WhitelistedDartVMFlag) { const std::vector options = { #if !FLUTTER_RELEASE - fml::CommandLine::Option("dart-flags", - "--max_profile_depth 1,--random_seed 42") + fml::CommandLine::Option("dart-flags", + "--max_profile_depth 1,--random_seed 42") #endif }; fml::CommandLine command_line("", options, std::vector()); From 516491577a3904d1d8ebf7ef2305b54d14a7e14d Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Mon, 30 Mar 2020 23:37:03 -0700 Subject: [PATCH 6/7] Do not run font tests in release mode --- testing/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/run_tests.py b/testing/run_tests.py index 083117458d448..68abca30b37de 100755 --- a/testing/run_tests.py +++ b/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) From f5b6bf3c5130bb17b6c881462933692b5bd310d8 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Tue, 31 Mar 2020 14:45:44 -0700 Subject: [PATCH 7/7] Fix a string test --- flutter_frontend_server/test/to_string_test.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flutter_frontend_server/test/to_string_test.dart b/flutter_frontend_server/test/to_string_test.dart index 3ee7570973a67..406d595716a71 100644 --- a/flutter_frontend_server/test/to_string_test.dart +++ b/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"}',