Commit 18890436 authored by sergiyb's avatar sergiyb Committed by Commit bot

Do not actually remove trees when testing bisect in dry-run mode

R=qyearsley@chromium.org, ojan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#296994}
parent f31a5ce1
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import os import os
import re import re
import shutil
import unittest import unittest
import bisect_perf_regression import bisect_perf_regression
...@@ -247,12 +248,18 @@ class BisectPerfRegressionTest(unittest.TestCase): ...@@ -247,12 +248,18 @@ class BisectPerfRegressionTest(unittest.TestCase):
This serves as a smoke test to catch errors in the basic execution of the This serves as a smoke test to catch errors in the basic execution of the
script. script.
""" """
bisect_instance = _GetBisectPerformanceMetricsInstance() # Disable rmtree to avoid deleting local trees.
results = bisect_instance.Run(bisect_instance.opts.command, old_rmtree = shutil.rmtree
bisect_instance.opts.bad_revision, try:
bisect_instance.opts.good_revision, shutil.rmtree = lambda path, onerror: None
bisect_instance.opts.metric) bisect_instance = _GetBisectPerformanceMetricsInstance()
bisect_instance.FormatAndPrintResults(results) 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): def testGetCommitPosition(self):
bisect_instance = _GetBisectPerformanceMetricsInstance() bisect_instance = _GetBisectPerformanceMetricsInstance()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment