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 @@
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()
......
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