Commit 3e014cb3 authored by machenbach's avatar machenbach Committed by Commit bot

[test] Pull benchmarks as a dependency.

BUG=chromium:535160
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#31359}
parent e678a0f9
...@@ -48,11 +48,7 @@ shell_g ...@@ -48,11 +48,7 @@ shell_g
/out /out
/perf.data /perf.data
/perf.data.old /perf.data.old
/test/benchmarks/CHECKED_OUT_* /test/benchmarks/data
/test/benchmarks/downloaded_*
/test/benchmarks/kraken
/test/benchmarks/octane
/test/benchmarks/sunspider
/test/mozilla/data /test/mozilla/data
/test/promises-aplus/promises-tests /test/promises-aplus/promises-tests
/test/promises-aplus/promises-tests.tar.gz /test/promises-aplus/promises-tests.tar.gz
......
...@@ -19,6 +19,8 @@ deps = { ...@@ -19,6 +19,8 @@ deps = {
Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87", Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87",
"v8/testing/gmock": "v8/testing/gmock":
Var("git_url") + "/external/googlemock.git" + "@" + "0421b6f358139f02e102c9c332ce19a33faf75be", Var("git_url") + "/external/googlemock.git" + "@" + "0421b6f358139f02e102c9c332ce19a33faf75be",
"v8/test/benchmarks/data":
Var("git_url") + "/v8/deps/third_party/benchmarks.git" + "@" + "05d7188267b4560491ff9155c5ee13e207ecd65f",
"v8/test/mozilla/data": "v8/test/mozilla/data":
Var("git_url") + "/v8/deps/third_party/mozilla-tests.git" + "@" + "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be", Var("git_url") + "/v8/deps/third_party/mozilla-tests.git" + "@" + "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be",
"v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "c8ef63c728283debc25891123eb00482fee4b8cd", "v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "c8ef63c728283debc25891123eb00482fee4b8cd",
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
import os import os
import shutil import shutil
import subprocess
import tarfile
from testrunner.local import statusfile from testrunner.local import statusfile
from testrunner.local import testsuite from testrunner.local import testsuite
...@@ -54,7 +52,7 @@ class BenchmarksTestSuite(testsuite.TestSuite): ...@@ -54,7 +52,7 @@ class BenchmarksTestSuite(testsuite.TestSuite):
def __init__(self, name, root): def __init__(self, name, root):
super(BenchmarksTestSuite, self).__init__(name, root) super(BenchmarksTestSuite, self).__init__(name, root)
self.testroot = root self.testroot = os.path.join(root, "data")
def ListTests(self, context): def ListTests(self, context):
tests = [] tests = []
...@@ -146,56 +144,25 @@ class BenchmarksTestSuite(testsuite.TestSuite): ...@@ -146,56 +144,25 @@ class BenchmarksTestSuite(testsuite.TestSuite):
with open(filename) as f: with open(filename) as f:
return f.read() return f.read()
def _DownloadIfNecessary(self, url, revision, target_dir):
# Maybe we're still up to date?
revision_file = "CHECKED_OUT_%s" % target_dir
checked_out_revision = None
if os.path.exists(revision_file):
with open(revision_file) as f:
checked_out_revision = f.read()
if checked_out_revision == revision:
return
# If we have a local archive file with the test data, extract it.
if os.path.exists(target_dir):
shutil.rmtree(target_dir)
archive_file = "downloaded_%s_%s.tar.gz" % (target_dir, revision)
if os.path.exists(archive_file):
with tarfile.open(archive_file, "r:gz") as tar:
tar.extractall()
with open(revision_file, "w") as f:
f.write(revision)
return
# No cached copy. Check out via SVN, and pack as .tar.gz for later use.
command = "svn co %s -r %s %s" % (url, revision, target_dir)
code = subprocess.call(command, shell=True)
if code != 0:
raise Exception("Error checking out %s benchmark" % target_dir)
with tarfile.open(archive_file, "w:gz") as tar:
tar.add("%s" % target_dir)
with open(revision_file, "w") as f:
f.write(revision)
def DownloadData(self): def DownloadData(self):
old_cwd = os.getcwd() print "Benchmarks download is deprecated. It's part of DEPS."
os.chdir(os.path.abspath(self.root))
def rm_dir(directory):
self._DownloadIfNecessary( directory_name = os.path.join(self.root, directory)
("http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/" if os.path.exists(directory_name):
"SunSpider/tests/sunspider-1.0.2/"), shutil.rmtree(directory_name)
"159499", "sunspider")
# Clean up old directories and archive files.
self._DownloadIfNecessary( rm_dir('kraken')
("http://kraken-mirror.googlecode.com/svn/trunk/kraken/tests/" rm_dir('octane')
"kraken-1.1/"), rm_dir('sunspider')
"8", "kraken") archive_files = [f for f in os.listdir(self.root)
if f.startswith("downloaded_") or
self._DownloadIfNecessary( f.startswith("CHECKED_OUT_")]
"http://octane-benchmark.googlecode.com/svn/trunk/", if len(archive_files) > 0:
"26", "octane") print "Clobber outdated test archives ..."
for f in archive_files:
os.chdir(old_cwd) os.remove(os.path.join(self.root, f))
def _VariantGeneratorFactory(self): def _VariantGeneratorFactory(self):
return BenchmarksVariantGenerator return BenchmarksVariantGenerator
......
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