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

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: Rebase 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c37d07f4ddc04318442250576a558d10d91bcb0a..a033d8baaaa336d0a18d6378f8037fb0920ec8ea 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
@@ -247,12 +248,18 @@ class BisectPerfRegressionTest(unittest.TestCase):
This serves as a smoke test to catch errors in the basic execution of the
script.
"""
- 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)
+ # Disable rmtree to avoid deleting local trees.
+ old_rmtree = shutil.rmtree
+ try:
+ shutil.rmtree = lambda path, onerror: None
+ 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)
+ finally:
+ shutil.rmtree = old_rmtree
def testGetCommitPosition(self):
bisect_instance = _GetBisectPerformanceMetricsInstance()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698