Bug 1331482 - Upload a list of manifests as an artifact in mochitest jobs r=jgraham

MozReview-Commit-ID: C0sVKADG70C

--HG--
extra : rebase_source : 9116cf821167b2724478d7de6279021c5720159d
This commit is contained in:
Andrew Halberstadt 2017-01-12 15:29:47 -05:00
Родитель c43421b470
Коммит 0e0e97f0a7
1 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -1375,6 +1375,11 @@ toolbar#nav-bar {
manifest.fmt_filters()))
paths = []
# When running mochitest locally the manifest is based on topsrcdir,
# but when running in automation it is based on the test root.
manifest_root = build_obj.topsrcdir if build_obj else self.testRootAbs
manifests = set()
for test in tests:
if len(tests) == 1 and 'disabled' in test:
del test['disabled']
@ -1389,6 +1394,8 @@ toolbar#nav-bar {
(test['name'], test['manifest']))
continue
manifests.add(os.path.relpath(test['manifest'], manifest_root))
testob = {'path': tp}
if 'disabled' in test:
testob['disabled'] = test['disabled']
@ -1404,16 +1411,22 @@ toolbar#nav-bar {
return cmp(path1, path2)
paths.sort(path_sort)
self._active_tests = paths
if options.dump_tests:
options.dump_tests = os.path.expanduser(options.dump_tests)
assert os.path.exists(os.path.dirname(options.dump_tests))
with open(options.dump_tests, 'w') as dumpFile:
dumpFile.write(json.dumps({'active_tests': self._active_tests}))
dumpFile.write(json.dumps({'active_tests': paths}))
self.log.info("Dumping active_tests to %s file." % options.dump_tests)
sys.exit()
# Upload a list of test manifests that were executed in this run.
if 'MOZ_UPLOAD_DIR' in os.environ:
artifact = os.path.join(os.environ['MOZ_UPLOAD_DIR'], 'manifests.list')
with open(artifact, 'a') as fh:
fh.write('\n'.join(sorted(manifests)))
self._active_tests = paths
return self._active_tests
def getTestManifest(self, options):