Commit a2a59723 authored by machenbach's avatar machenbach Committed by Commit bot

[test] Deprecate test data download for most test suites

This removes the test-download method for all but
promises-aplus. They all only contain legacy code for
deleting old archives.

Only test262 needs to prepare sources on swarming, which is
moved to a new method, called unconditionally.

All references to --download-data and --download-data-only
in the infrastructure can be removed after this.

BUG=

Review-Url: https://codereview.chromium.org/2227613002
Cr-Commit-Position: refs/heads/master@{#38439}
parent 76949ba4
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
import os import os
import shutil
import subprocess
from testrunner.local import testsuite from testrunner.local import testsuite
from testrunner.objects import testcase from testrunner.objects import testcase
...@@ -112,21 +110,6 @@ class MozillaTestSuite(testsuite.TestSuite): ...@@ -112,21 +110,6 @@ class MozillaTestSuite(testsuite.TestSuite):
return True return True
return "FAILED!" in testcase.output.stdout return "FAILED!" in testcase.output.stdout
def DownloadData(self):
print "Mozilla download is deprecated. It's part of DEPS."
# Clean up old directories and archive files.
directory_old_name = os.path.join(self.root, "data.old")
if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_name)
archive_files = [f for f in os.listdir(self.root)
if f.startswith("downloaded_")]
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
os.remove(os.path.join(self.root, f))
def GetSuite(name, root): def GetSuite(name, root):
return MozillaTestSuite(name, root) return MozillaTestSuite(name, root)
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import os import os
import shutil
import sys import sys
from testrunner.local import testsuite from testrunner.local import testsuite
...@@ -53,21 +52,6 @@ class SimdJsTestSuite(testsuite.TestSuite): ...@@ -53,21 +52,6 @@ class SimdJsTestSuite(testsuite.TestSuite):
return True return True
return "FAILED!" in testcase.output.stdout return "FAILED!" in testcase.output.stdout
def DownloadData(self):
print "SimdJs download is deprecated. It's part of DEPS."
# Clean up old directories and archive files.
directory_old_name = os.path.join(self.root, "data.old")
if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_name)
archive_files = [f for f in os.listdir(self.root)
if f.startswith("ecmascript_simd-")]
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
os.remove(os.path.join(self.root, f))
def GetSuite(name, root): def GetSuite(name, root):
return SimdJsTestSuite(name, root) return SimdJsTestSuite(name, root)
...@@ -26,10 +26,8 @@ ...@@ -26,10 +26,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import hashlib
import imp import imp
import os import os
import shutil
import sys import sys
import tarfile import tarfile
...@@ -208,21 +206,7 @@ class Test262TestSuite(testsuite.TestSuite): ...@@ -208,21 +206,7 @@ class Test262TestSuite(testsuite.TestSuite):
return outcome != statusfile.FAIL return outcome != statusfile.FAIL
return not outcome in (testcase.outcomes or [statusfile.PASS]) return not outcome in (testcase.outcomes or [statusfile.PASS])
def DownloadData(self): def PrepareSources(self):
print "Test262 download is deprecated. It's part of DEPS."
# Clean up old directories and archive files.
directory_old_name = os.path.join(self.root, "data.old")
if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_name)
archive_files = [f for f in os.listdir(self.root)
if f.startswith("tc39-test262-")]
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
os.remove(os.path.join(self.root, f))
# The archive is created only on swarming. Local checkouts have the # The archive is created only on swarming. Local checkouts have the
# data folder. # data folder.
if os.path.exists(ARCHIVE) and not os.path.exists(DATA): if os.path.exists(ARCHIVE) and not os.path.exists(DATA):
......
...@@ -252,7 +252,7 @@ def BuildOptions(): ...@@ -252,7 +252,7 @@ def BuildOptions():
result.add_option("--download-data", help="Download missing test suite data", result.add_option("--download-data", help="Download missing test suite data",
default=False, action="store_true") default=False, action="store_true")
result.add_option("--download-data-only", result.add_option("--download-data-only",
help="Download missing test suite data and exit", help="Deprecated",
default=False, action="store_true") default=False, action="store_true")
result.add_option("--extra-flags", result.add_option("--extra-flags",
help="Additional flags to pass to each test command", help="Additional flags to pass to each test command",
...@@ -667,6 +667,9 @@ def Main(): ...@@ -667,6 +667,9 @@ def Main():
if options.download_data_only: if options.download_data_only:
return exit_code return exit_code
for s in suites:
s.PrepareSources()
for (arch, mode) in options.arch_and_mode: for (arch, mode) in options.arch_and_mode:
try: try:
code = Execute(arch, mode, args, options, suites) code = Execute(arch, mode, args, options, suites)
......
...@@ -125,6 +125,14 @@ class TestSuite(object): ...@@ -125,6 +125,14 @@ class TestSuite(object):
""" """
return self._VariantGeneratorFactory()(self, set(variants)) return self._VariantGeneratorFactory()(self, set(variants))
def PrepareSources(self):
"""Called once before multiprocessing for doing file-system operations.
This should not access the network. For network access use the method
below.
"""
pass
def DownloadData(self): def DownloadData(self):
pass pass
......
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