Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1649)

Unified Diff: base/test/launcher/test_launcher.cc

Issue 2411003003: Save an early test summary in case the test launcher crashes or gets killed (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/launcher/test_launcher.h ('k') | base/test/launcher/test_results_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 4b86c5621a938f7b57b7c2300ffa5437e1a9e6c8..e6880fa54f5f462acb4c3050e78b2f3f143a8885 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -536,7 +536,7 @@ bool TestLauncher::Run() {
if (requested_cycles != 1)
results_tracker_.PrintSummaryOfAllIterations();
- MaybeSaveSummaryAsJSON();
+ MaybeSaveSummaryAsJSON(std::vector<std::string>());
return run_result_;
}
@@ -656,9 +656,7 @@ void TestLauncher::OnTestFinished(const TestResult& result) {
KillSpawnedTestProcesses();
#endif // defined(OS_POSIX)
- results_tracker_.AddGlobalTag("BROKEN_TEST_EARLY_EXIT");
- results_tracker_.AddGlobalTag(kUnreliableResultsTag);
- MaybeSaveSummaryAsJSON();
+ MaybeSaveSummaryAsJSON({"BROKEN_TEST_EARLY_EXIT", kUnreliableResultsTag});
exit(1);
}
@@ -989,6 +987,9 @@ void TestLauncher::RunTests() {
test_names.push_back(test_name);
}
+ // Save an early test summary in case the launcher crashes or gets killed.
+ MaybeSaveSummaryAsJSON({"EARLY_SUMMARY", kUnreliableResultsTag});
+
test_started_count_ = launcher_delegate_->RunTests(this, test_names);
if (test_started_count_ == 0) {
@@ -1026,12 +1027,13 @@ void TestLauncher::RunTestIteration() {
FROM_HERE, Bind(&TestLauncher::RunTests, Unretained(this)));
}
-void TestLauncher::MaybeSaveSummaryAsJSON() {
+void TestLauncher::MaybeSaveSummaryAsJSON(
+ const std::vector<std::string>& additional_tags) {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kTestLauncherSummaryOutput)) {
FilePath summary_path(command_line->GetSwitchValuePath(
switches::kTestLauncherSummaryOutput));
- if (!results_tracker_.SaveSummaryAsJSON(summary_path)) {
+ if (!results_tracker_.SaveSummaryAsJSON(summary_path, additional_tags)) {
LOG(ERROR) << "Failed to save test launcher output summary.";
}
}
« no previous file with comments | « base/test/launcher/test_launcher.h ('k') | base/test/launcher/test_results_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698