Skip to content

Commit

Permalink
Revert 231359 "GTTF: make sharding_supervisor.py use --brave-new..."
Browse files Browse the repository at this point in the history
This broke Mac interactive_ui_tests

> GTTF: make sharding_supervisor.py use --brave-new-test-launcher
> 
> - browser tests use parallel jobs by default (except interactive_ui_tests)
> - sharding + PRE_ tests are handled correctly
> - .isolate files updated
> 
> BUG=236893
> R=maruel@chromium.org, sky@chromium.org
> 
> Review URL: https://codereview.chromium.org/46023003

TBR=phajdan.jr@chromium.org

Review URL: https://codereview.chromium.org/48113008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231371 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rmsousa@chromium.org committed Oct 28, 2013
1 parent 44d0930 commit b3f9f40
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 204 deletions.
4 changes: 2 additions & 2 deletions base/base_unittests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
'command': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)',
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/base_unittests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
],
'isolate_dependency_tracked': [
'../testing/xvfb.py',
Expand All @@ -40,8 +40,8 @@
'variables': {
'command': [
'../testing/test_env.py',
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/base_unittests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
],
},
}],
Expand Down
3 changes: 2 additions & 1 deletion base/test/launcher/test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ void TestLauncher::RunTests() {
}
}

test_started_count_ = launcher_delegate_->RunTests(this, test_names);
test_started_count_ = test_names.size();
launcher_delegate_->RunTests(this, test_names);

if (test_started_count_ == 0) {
fprintf(stdout, "0 tests run\n");
Expand Down
10 changes: 4 additions & 6 deletions base/test/launcher/test_launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ class TestLauncherDelegate {
const testing::TestInfo* test_info) = 0;

// Called to make the delegate run the specified tests. The delegate must
// return the number of actual tests it's going to run (can be smaller,
// equal to, or larger than size of |test_names|). It must also call
// |test_launcher|'s OnTestFinished method once per every run test,
// regardless of its success.
virtual size_t RunTests(TestLauncher* test_launcher,
const std::vector<std::string>& test_names) = 0;
// call |test_launcher|'s OnTestFinished method once per every test in
// |test_names|, regardless of its success.
virtual void RunTests(TestLauncher* test_launcher,
const std::vector<std::string>& test_names) = 0;

// Called to make the delegate retry the specified tests. The delegate must
// return the number of actual tests it's going to retry (can be smaller,
Expand Down
6 changes: 2 additions & 4 deletions base/test/launcher/unit_test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
return true;
}

virtual size_t RunTests(TestLauncher* test_launcher,
const std::vector<std::string>& test_names) OVERRIDE {
virtual void RunTests(TestLauncher* test_launcher,
const std::vector<std::string>& test_names) OVERRIDE {
DCHECK(thread_checker_.CalledOnValidThread());

std::vector<std::string> batch;
Expand All @@ -130,8 +130,6 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
}

RunBatch(test_launcher, batch);

return test_names.size();
}

virtual size_t RetryTests(
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
'command': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)',
'../tools/swarm_client/googletest/run_test_cases.py',
'--use-less-jobs',
'<(PRODUCT_DIR)/browser_tests<(EXECUTABLE_SUFFIX)',
],
'isolate_dependency_tracked': [
Expand Down Expand Up @@ -127,6 +129,8 @@
'variables': {
'command': [
'../testing/test_env.py',
'../tools/swarm_client/googletest/run_test_cases.py',
'--use-less-jobs',
'<(PRODUCT_DIR)/browser_tests<(EXECUTABLE_SUFFIX)',
],
},
Expand Down
34 changes: 6 additions & 28 deletions chrome/chrome_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,6 @@
'js_unittest_vars.gypi',
],
'targets': [
{
'target_name': 'test_support_chrome',
'type': 'static_library',
'dependencies': [
'test_support_common',
'../testing/gtest.gyp:gtest',
],
'export_dependent_settings': [
'test_support_common',
],
'include_dirs': [
'..',
],
'sources': [
'test/base/chrome_test_launcher.cc',
'test/base/chrome_test_launcher.h',
],
},
{
'target_name': 'test_support_ui_runner',
'type': 'static_library',
Expand Down Expand Up @@ -169,7 +151,6 @@
'common/extensions/api/api.gyp:api',
'debugger',
'renderer',
'test_support_chrome',
'test_support_common',
# NOTE: don't add test_support_ui, no more UITests. See
# http://crbug.com/137365
Expand Down Expand Up @@ -197,6 +178,7 @@
],
'defines': [
'HAS_OUT_OF_PROC_TEST_RUNNER',
'INTERACTIVE_TESTS',
],
'variables': {
'win_use_external_manifest': 1,
Expand Down Expand Up @@ -284,6 +266,7 @@
'browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc',
'browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h',
'browser/ui/views/tabs/tab_drag_controller_interactive_uitest_win.cc',
'test/base/chrome_test_launcher.cc',
'test/base/interactive_test_utils.cc',
'test/base/interactive_test_utils.h',
'test/base/interactive_test_utils_aura.cc',
Expand All @@ -292,7 +275,6 @@
'test/base/interactive_test_utils_mac.mm',
'test/base/interactive_test_utils_views.cc',
'test/base/interactive_test_utils_win.cc',
'test/base/interactive_ui_tests_main.cc',
'test/base/view_event_test_base.cc',
'test/base/view_event_test_base.h',
'test/ppapi/ppapi_interactive_browsertest.cc',
Expand Down Expand Up @@ -940,7 +922,6 @@
'common/extensions/api/api.gyp:api',
'renderer',
'test/perf/perf_test.gyp:*',
'test_support_chrome',
'test_support_common',
'test_support_unit',
'../base/base.gyp:base',
Expand Down Expand Up @@ -1560,9 +1541,9 @@
'renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc',
'renderer/translate/translate_helper_browsertest.cc',
'renderer/translate/translate_script_browsertest.cc',
'test/base/browser_tests_main.cc',
'test/base/chrome_render_view_test.cc',
'test/base/chrome_render_view_test.h',
'test/base/chrome_test_launcher.cc',
'test/base/web_ui_browsertest.cc',
'test/base/web_ui_browsertest.h',
'test/base/in_process_browser_test_browsertest.cc',
Expand Down Expand Up @@ -2019,7 +2000,6 @@
'chrome_resources.gyp:packed_resources',
'renderer',
'test/perf/perf_test.gyp:*',
'test_support_chrome',
'test_support_common',
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
Expand Down Expand Up @@ -2056,9 +2036,9 @@
'browser/extensions/extension_apitest.cc',
'browser/extensions/extension_browsertest.cc',
'browser/extensions/extension_test_notification_observer.cc',
'test/base/browser_tests_main.cc',
'test/base/chrome_render_view_test.cc',
'test/base/chrome_render_view_test.h',
'test/base/chrome_test_launcher.cc',
'test/perf/browser_perf_test.cc',
'test/perf/browser_perf_test.h',
'test/perf/rendering/throughput_tests.cc',
Expand Down Expand Up @@ -2287,7 +2267,6 @@
'common',
'common/extensions/api/api.gyp:api',
'renderer',
'test_support_chrome',
'test_support_common',
'../net/net.gyp:net',
'../printing/printing.gyp:printing',
Expand Down Expand Up @@ -2316,7 +2295,7 @@
'app/chrome_dll.rc',
'app/chrome_dll_resource.h',
'app/chrome_version.rc.version',
'test/base/browser_tests_main.cc',
'test/base/chrome_test_launcher.cc',
'test/data/resource.rc',
'browser/sync/test/integration/apps_helper.cc',
'browser/sync/test/integration/apps_helper.h',
Expand Down Expand Up @@ -2468,7 +2447,6 @@
'chrome',
'common/extensions/api/api.gyp:api',
'test/perf/perf_test.gyp:*',
'test_support_chrome',
'test_support_common',
'../skia/skia.gyp:skia',
'../sync/sync.gyp:sync',
Expand Down Expand Up @@ -2520,7 +2498,7 @@
'browser/sync/test/integration/sync_test.h',
'browser/sync/test/integration/typed_urls_helper.cc',
'browser/sync/test/integration/typed_urls_helper.h',
'test/base/browser_tests_main.cc',
'test/base/chrome_test_launcher.cc',
'test/data/resource.rc',
],
'conditions': [
Expand Down
4 changes: 4 additions & 0 deletions chrome/interactive_ui_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
'command': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)',
'../tools/swarm_client/googletest/run_test_cases.py',
'-j1',
'<(PRODUCT_DIR)/interactive_ui_tests<(EXECUTABLE_SUFFIX)',
],
'isolate_dependency_tracked': [
Expand Down Expand Up @@ -65,6 +67,8 @@
'variables': {
'command': [
'../testing/test_env.py',
'../tools/swarm_client/googletest/run_test_cases.py',
'-j1',
'<(PRODUCT_DIR)/interactive_ui_tests<(EXECUTABLE_SUFFIX)',
],
},
Expand Down
2 changes: 2 additions & 0 deletions chrome/sync_integration_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'command': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)',
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/sync_integration_tests<(EXECUTABLE_SUFFIX)',
],
'isolate_dependency_tracked': [
Expand Down Expand Up @@ -51,6 +52,7 @@
['OS=="mac"', {
'variables': {
'command': [
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/sync_integration_tests<(EXECUTABLE_SUFFIX)',
],
'isolate_dependency_tracked': [
Expand Down
11 changes: 0 additions & 11 deletions chrome/test/base/browser_tests_main.cc

This file was deleted.

28 changes: 22 additions & 6 deletions chrome/test/base/chrome_test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
#include "chrome/app/chrome_breakpad_client.h"
#endif

namespace {

class ChromeTestLauncherDelegate : public content::TestLauncherDelegate {
public:
ChromeTestLauncherDelegate() {}
Expand Down Expand Up @@ -128,13 +126,31 @@ class ChromeTestLauncherDelegate : public content::TestLauncherDelegate {
DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate);
};

} // namespace

int LaunchChromeTests(int default_jobs, int argc, char** argv) {
int main(int argc, char** argv) {
#if defined(OS_MACOSX)
chrome_browser_application_mac::RegisterBrowserCrApp();
#endif

// Only allow ui_controls to be used in interactive_ui_tests, since they depend
// on focus and can't be sharded.
#if defined(INTERACTIVE_TESTS)
ui_controls::EnableUIControls();

#if defined(OS_CHROMEOS)
ui_controls::InstallUIControlsAura(ash::test::CreateAshUIControls());
#elif defined(USE_AURA)

#if defined(OS_LINUX)
ui_controls::InstallUIControlsAura(
views::test::CreateUIControlsDesktopAura());
#else
// TODO(win_ash): when running interactive_ui_tests for Win Ash, use above.
ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL));
#endif
#endif

#endif

#if defined(OS_LINUX) || defined(OS_ANDROID)
// We leak this pointer intentionally. The breakpad client needs to outlive
// all other code.
Expand All @@ -145,5 +161,5 @@ int LaunchChromeTests(int default_jobs, int argc, char** argv) {
#endif

ChromeTestLauncherDelegate launcher_delegate;
return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv);
return content::LaunchTests(&launcher_delegate, argc, argv);
}
13 changes: 0 additions & 13 deletions chrome/test/base/chrome_test_launcher.h

This file was deleted.

41 changes: 0 additions & 41 deletions chrome/test/base/interactive_ui_tests_main.cc

This file was deleted.

4 changes: 2 additions & 2 deletions chrome/unit_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
'command': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)',
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/unit_tests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
],
'isolate_dependency_tracked': [
'../testing/xvfb.py',
Expand Down Expand Up @@ -86,8 +86,8 @@
'variables': {
'command': [
'../testing/test_env.py',
'../tools/swarm_client/googletest/run_test_cases.py',
'<(PRODUCT_DIR)/unit_tests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
],
'isolate_dependency_untracked': [
'<(PRODUCT_DIR)/test_data/chrome/browser/resources/google_now/',
Expand Down
Loading

0 comments on commit b3f9f40

Please sign in to comment.