Commit 63afdb00 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Work-around for checking test262 archives on bots

This relaxes the check if the test262 archive should be unpacked or not.
A bug in the swarming isolate processor for windows makes the old check for the data directory pass and not unpack.
With this work-around we actually start running tests on windows.

This also fixes the regexp for exception extraction and handles the windows drive letter.
It also strips whitespace to fix a case where a carriage return was included on windows.

BUG=v8:5872

Change-Id: I363925665b0bad7530a1f93a2ea8f39b056d4174
Reviewed-on: https://chromium-review.googlesource.com/445786
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarDaniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43482}
parent fc8922e4
...@@ -203,19 +203,26 @@ class Test262TestSuite(testsuite.TestSuite): ...@@ -203,19 +203,26 @@ class Test262TestSuite(testsuite.TestSuite):
with open(self.GetPathForTest(testcase)) as f: with open(self.GetPathForTest(testcase)) as f:
return f.read() return f.read()
def _ParseException(self, str): def _ParseException(self, str, testcase):
# somefile:somelinenumber: someerror[: sometext] # somefile:somelinenumber: someerror[: sometext]
match = re.search('^[^: ]*:[0-9]+: ([^ ]+?)($|: )', str, re.MULTILINE) # somefile might include an optional drive letter on windows e.g. "e:".
return match.group(1) match = re.search(
'^(?:\w:)?[^:]*:[0-9]+: ([^: ]+?)($|: )', str, re.MULTILINE)
if match:
return match.group(1).strip()
else:
print "Error parsing exception for %s" % testcase.GetLabel()
return None
def IsFailureOutput(self, testcase): def IsFailureOutput(self, testcase):
output = testcase.output output = testcase.output
test_record = self.GetTestRecord(testcase) test_record = self.GetTestRecord(testcase)
if output.exit_code != 0: if output.exit_code != 0:
return True return True
if "negative" in test_record and \ if ("negative" in test_record and
"type" in test_record["negative"] and \ "type" in test_record["negative"] and
self._ParseException(output.stdout) != test_record["negative"]["type"]: self._ParseException(output.stdout, testcase) !=
test_record["negative"]["type"]):
return True return True
return "FAILED!" in output.stdout return "FAILED!" in output.stdout
...@@ -231,7 +238,13 @@ class Test262TestSuite(testsuite.TestSuite): ...@@ -231,7 +238,13 @@ class Test262TestSuite(testsuite.TestSuite):
def PrepareSources(self): def PrepareSources(self):
# 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
# Check for a JS file from the archive if we need to unpack. Some other
# files from the archive unfortunately exist due to a bug in the
# isolate_processor.
# TODO(machenbach): Migrate this to GN to avoid using the faulty
# isolate_processor: http://crbug.com/669910
not os.path.exists(os.path.join(DATA, 'test', 'harness', 'error.js'))):
print "Extracting archive..." print "Extracting archive..."
tar = tarfile.open(ARCHIVE) tar = tarfile.open(ARCHIVE)
tar.extractall(path=os.path.dirname(ARCHIVE)) tar.extractall(path=os.path.dirname(ARCHIVE))
......
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