From eabb39ad5fc9fde520993f6e1e7e9e9af50f77a0 Mon Sep 17 00:00:00 2001 From: nturgut Date: Tue, 13 Oct 2020 19:26:34 -0700 Subject: [PATCH] [web] enabling firefox screenshot tests. adding to documentation (flutter/engine#21807) * enabling firefox screenshot tests. adding to documentation * test with correct goldens * update goldens SHA * change the goldens with flutter/goldens repo * do not run preparation step twice. this will cause test_results to be deleted --- engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml | 2 +- engine/src/flutter/lib/web_ui/dev/test_runner.dart | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml b/engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml index 579e6c5086..66a641aed6 100644 --- a/engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml +++ b/engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml @@ -1,2 +1,2 @@ repository: https://github.com/flutter/goldens.git -revision: da3fef0c0eb849dfbb14b09a088c5f7916677482 +revision: 672510dc52daa5b059081f6990582bccdb4ea48f diff --git a/engine/src/flutter/lib/web_ui/dev/test_runner.dart b/engine/src/flutter/lib/web_ui/dev/test_runner.dart index 74c8de6d89..9538a380ec 100644 --- a/engine/src/flutter/lib/web_ui/dev/test_runner.dart +++ b/engine/src/flutter/lib/web_ui/dev/test_runner.dart @@ -103,6 +103,13 @@ class TestCommand extends Command with ArgUtils { /// How many dart2js build tasks are running at the same time. final Pool _pool = Pool(8); + /// Checks if test harness preparation (such as fetching the goldens, + /// creating test_results directory or starting ios-simulator) has been done. + /// + /// If unit tests already did these steps, integration tests do not have to + /// repeat them. + bool _testPreparationReady = false; + /// Check the flags to see what type of tests are requested. TestTypesRequested findTestType() { if (boolArg('unit-tests-only') && boolArg('integration-tests-only')) { @@ -158,7 +165,9 @@ class TestCommand extends Command with ArgUtils { } Future runIntegrationTests() async { - await _prepare(); + if(!_testPreparationReady) { + await _prepare(); + } return IntegrationTestsManager( browser, useSystemFlutter, doUpdateScreenshotGoldens) .runTests(); @@ -207,6 +216,7 @@ class TestCommand extends Command with ArgUtils { if (isSafariIOS) { await IosSafariArgParser.instance.initIosSimulator(); } + _testPreparationReady = true; } /// Builds all test targets that will be run.