Commit 14bfa18b authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Remove deprecated test-download feature

Bug: v8:6917
Change-Id: I3889cd0d059c3473a7b83eb298734a7a6a8a1de5
Reviewed-on: https://chromium-review.googlesource.com/712175Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48467}
parent 83103bce
......@@ -144,26 +144,6 @@ class BenchmarksTestSuite(testsuite.TestSuite):
with open(filename) as f:
return f.read()
def DownloadData(self):
print "Benchmarks download is deprecated. It's part of DEPS."
def rm_dir(directory):
directory_name = os.path.join(self.root, directory)
if os.path.exists(directory_name):
shutil.rmtree(directory_name)
# Clean up old directories and archive files.
rm_dir('kraken')
rm_dir('octane')
rm_dir('sunspider')
archive_files = [f for f in os.listdir(self.root)
if f.startswith("downloaded_") or
f.startswith("CHECKED_OUT_")]
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
os.remove(os.path.join(self.root, f))
def _VariantGeneratorFactory(self):
return BenchmarksVariantGenerator
......
......@@ -37,20 +37,15 @@ from testrunner.local import utils
from testrunner.objects import testcase
SINON_TAG = '1.7.3'
SINON_NAME = 'sinon'
SINON_FILENAME = 'sinon.js'
SINON_URL = 'http://sinonjs.org/releases/sinon-' + SINON_TAG + '.js'
SINON_HASH = 'b7ab4dd9a1a2cf0460784af3728ad15caf4bbea923f680c5abde5c8332f35984'
TEST_TAG = '2.0.3'
TEST_ARCHIVE_TOP = 'promises-tests-' + TEST_TAG
"""
Requirements for using this test suite:
Download http://sinonjs.org/releases/sinon-1.7.3.js into
test/promises-aplus/sinon.
Download https://github.com/promises-aplus/promises-tests/tree/2.0.3 into
test/promises-aplus/promises-tests.
"""
TEST_NAME = 'promises-tests'
TEST_ARCHIVE = TEST_NAME + '.tar.gz'
TEST_URL = 'https://github.com/promises-aplus/promises-tests/archive/' + \
TEST_TAG + '.tar.gz'
TEST_ARCHIVE_HASH = \
'e446ca557ac5836dd439fecd19689c243a28b1d5a6644dd7fed4274d0fa67270'
class PromiseAplusTestSuite(testsuite.TestSuite):
......@@ -97,51 +92,5 @@ class PromiseAplusTestSuite(testsuite.TestSuite):
return not 'All tests have run.' in testcase.output.stdout or \
'FAIL:' in testcase.output.stdout
def DownloadTestData(self):
archive = os.path.join(self.root, TEST_ARCHIVE)
directory = os.path.join(self.root, TEST_NAME)
if not os.path.exists(archive):
print('Downloading {0} from {1} ...'.format(TEST_NAME, TEST_URL))
utils.URLRetrieve(TEST_URL, archive)
if os.path.exists(directory):
shutil.rmtree(directory)
if not os.path.exists(directory):
print('Extracting {0} ...'.format(TEST_ARCHIVE))
hash = hashlib.sha256()
with open(archive, 'rb') as f:
for chunk in iter(lambda: f.read(8192), ''):
hash.update(chunk)
if hash.hexdigest() != TEST_ARCHIVE_HASH:
os.remove(archive)
raise Exception('Hash mismatch of test data file')
archive = tarfile.open(archive, 'r:gz')
if sys.platform in ('win32', 'cygwin'):
# Magic incantation to allow longer path names on Windows.
archive.extractall(u'\\\\?\\%s' % self.root)
else:
archive.extractall(self.root)
shutil.move(os.path.join(self.root, TEST_ARCHIVE_TOP), directory)
def DownloadSinon(self):
directory = os.path.join(self.root, SINON_NAME)
if not os.path.exists(directory):
os.mkdir(directory)
path = os.path.join(directory, SINON_FILENAME)
if not os.path.exists(path):
utils.URLRetrieve(SINON_URL, path)
hash = hashlib.sha256()
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(8192), ''):
hash.update(chunk)
if hash.hexdigest() != SINON_HASH:
os.remove(path)
raise Exception('Hash mismatch of test data file')
def DownloadData(self):
self.DownloadTestData()
self.DownloadSinon()
def GetSuite(name, root):
return PromiseAplusTestSuite(name, root)
......@@ -172,8 +172,6 @@ def BuildOptions():
result.add_option("--coverage-lift", help=("Lifts test coverage for tests "
"with a small number of deopt points (range 0, inf)"),
default=20, type="int")
result.add_option("--download-data", help="Download missing test suite data",
default=False, action="store_true")
result.add_option("--distribution-factor1", help=("Factor of the first "
"derivation of the distribution function"), default=2.0,
type="float")
......@@ -318,10 +316,6 @@ def Main():
if suite:
suites.append(suite)
if options.download_data:
for s in suites:
s.DownloadData()
for mode in options.mode:
for arch in options.arch:
try:
......
......@@ -256,11 +256,6 @@ def BuildOptions():
result.add_option("--command-prefix",
help="Prepended to each shell command used to run a test",
default="")
result.add_option("--download-data", help="Download missing test suite data",
default=False, action="store_true")
result.add_option("--download-data-only",
help="Deprecated",
default=False, action="store_true")
result.add_option("--extra-flags",
help="Additional flags to pass to each test command",
action="append", default=[])
......@@ -741,13 +736,6 @@ def Main():
if suite:
suites.append(suite)
if options.download_data or options.download_data_only:
for s in suites:
s.DownloadData()
if options.download_data_only:
return exit_code
for s in suites:
s.PrepareSources()
......
......@@ -131,9 +131,6 @@ class TestSuite(object):
"""
pass
def DownloadData(self):
pass
def ReadStatusFile(self, variables):
with open(self.status_file()) as f:
self.rules, self.wildcards = (
......
......@@ -106,9 +106,6 @@ def Execute(workspace, ctx, tests, sock, server):
suite.tests.append(t)
suites = [ s for s in suites if len(s.tests) > 0 ]
for s in suites:
s.DownloadData()
progress_indicator = EndpointProgress(sock, server, ctx)
runner = execution.Runner(suites, progress_indicator, ctx)
try:
......
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