summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorsteveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 05:08:11 +0000
committersteveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 05:08:11 +0000
commit180e950f9e1cd48ada5e25859acaefd490a1d168 (patch)
tree55bf0c658700e08e30afb3acab4927eaab78a8e4 /media
parent620678921674c6c053a6d92a5a73279e8dac3822 (diff)
downloadchromium_src-180e950f9e1cd48ada5e25859acaefd490a1d168.zip
chromium_src-180e950f9e1cd48ada5e25859acaefd490a1d168.tar.gz
chromium_src-180e950f9e1cd48ada5e25859acaefd490a1d168.tar.bz2
Fix test_expectations_history.py to avoid writing intermediates to local directory
Instead use mkdtemp(). TEST=python media/tools/layout_tests/test_expectations_history_unittest.py Review URL: https://codereview.chromium.org/14323007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/tools/layout_tests/test_expectations_history.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/media/tools/layout_tests/test_expectations_history.py b/media/tools/layout_tests/test_expectations_history.py
index 8030632..5d03e0f 100644
--- a/media/tools/layout_tests/test_expectations_history.py
+++ b/media/tools/layout_tests/test_expectations_history.py
@@ -7,8 +7,10 @@
from datetime import datetime
from datetime import timedelta
+import os
import re
import sys
+import tempfile
import time
import pysvn
@@ -59,14 +61,16 @@ class TestExpectationsHistory(object):
A list of tuples (old_rev, new_rev, author, date, message, lines). The
|lines| contains the diff of the tests of interest.
"""
+ temp_directory = tempfile.mkdtemp()
+ test_expectations_path = os.path.join(temp_directory, 'TestExpectations')
# Get directory name which is necesary to call PySVN.checkout().
te_location_dir = te_location[0:te_location.rindex('/')]
client = pysvn.Client()
- client.checkout(te_location_dir, 'tmp', recurse=False)
+ client.checkout(te_location_dir, temp_directory, recurse=False)
# PySVN.log() (http://pysvn.tigris.org/docs/pysvn_prog_ref.html
# #pysvn_client_log) returns the log messages (including revision
# number in chronological order).
- logs = client.log('tmp/TestExpectations',
+ logs = client.log(test_expectations_path,
revision_start=pysvn.Revision(
pysvn.opt_revision_kind.date, start),
revision_end=pysvn.Revision(
@@ -78,7 +82,7 @@ class TestExpectationsHistory(object):
(datetime.fromtimestamp(start) - (
timedelta(days=gobackdays))).timetuple())
logs_before_time_period = (
- client.log('tmp/TestExpectations',
+ client.log(test_expectations_path,
revision_start=pysvn.Revision(
pysvn.opt_revision_kind.date, goback_start),
revision_end=pysvn.Revision(
@@ -99,7 +103,7 @@ class TestExpectationsHistory(object):
old_path = TestExpectationsHistory.GetTestExpectationsPathForRevision(
old_rev);
- text = client.diff('/tmp',
+ text = client.diff(temp_directory,
url_or_path=old_path,
revision1=pysvn.Revision(
pysvn.opt_revision_kind.number, old_rev),