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

Unified Diff: tools/auto_bisect/bisect_perf_regression_test.py

Issue 584853002: Do not actually remove trees when test bisect in dry-run mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bisect-move
Patch Set: Created 6 years, 3 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
Index: tools/auto_bisect/bisect_perf_regression_test.py
diff --git a/tools/auto_bisect/bisect_perf_regression_test.py b/tools/auto_bisect/bisect_perf_regression_test.py
index d25992d18adf04272348130d85d096b1b2374aa0..80f9e0930871a11a3052739981d4191943c402a0 100644
--- a/tools/auto_bisect/bisect_perf_regression_test.py
+++ b/tools/auto_bisect/bisect_perf_regression_test.py
@@ -4,6 +4,7 @@
import os
import re
+import shutil
import unittest
import bisect_perf_regression
@@ -246,12 +247,16 @@ class BisectPerfRegressionTest(unittest.TestCase):
This serves as a smoke test to catch errors in the basic execution of the
script.
"""
+ # Disable rmtree to avoid deleting local trees.
+ old_rmtree = shutil.rmtree
+ shutil.rmtree = lambda path, onerror: None
ojan 2014/09/19 17:42:52 I typically do this in a try/finally so you can be
Sergiy Byelozyorov 2014/09/22 20:04:15 Done.
bisect_instance = _GetBisectPerformanceMetricsInstance()
results = bisect_instance.Run(bisect_instance.opts.command,
bisect_instance.opts.bad_revision,
bisect_instance.opts.good_revision,
bisect_instance.opts.metric)
bisect_instance.FormatAndPrintResults(results)
+ shutil.rmtree = old_rmtree
def testGetCommitPosition(self):
bisect_instance = _GetBisectPerformanceMetricsInstance()
« tools/auto_bisect/bisect_perf_regression.py ('K') | « tools/auto_bisect/bisect_perf_regression.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698