Skip to content

Commit

Permalink
Bug 1330421 - Update artifact code to populate generated test support…
Browse files Browse the repository at this point in the history
… files from the tests archive. r=gps

This updates the client artifact code to locate test support files in the
common test archive and populate the objdir with these files appropriately.

MozReview-Commit-ID: GuXjwUtsl
  • Loading branch information
chmanchester committed Jan 12, 2017
1 parent 3ee0c55 commit 44791f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ ifdef JS_STANDALONE
NO_REMOVE=1
endif

# For an artifact build, _tests will already be partly populated, so run
# this install manifest with NO_REMOVE set in this case.
ifdef MOZ_ARTIFACT_BUILDS
install-_tests: NO_REMOVE=1
endif

.PHONY: $(addprefix install-,$(subst /,_,$(install_manifests)))
$(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
Expand Down
12 changes: 12 additions & 0 deletions python/mozbuild/mozbuild/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import pylru
import taskcluster

from mozbuild.action.test_archive import OBJDIR_TEST_FILES
from mozbuild.util import (
ensureParentDir,
FileAvoidWrite,
Expand Down Expand Up @@ -196,6 +197,17 @@ def process_tests_artifact(self, filename, processed_filename):
mode = entry['external_attr'] >> 16
writer.add(destpath.encode('utf-8'), reader[filename], mode=mode)
added_entry = True
for files_entry in OBJDIR_TEST_FILES.values():
origin_pattern = files_entry['pattern']
leaf_filename = filename
if 'dest' in files_entry:
dest = files_entry['dest']
origin_pattern = mozpath.join(dest, origin_pattern)
leaf_filename = filename[len(dest) + 1:]
if mozpath.match(filename, origin_pattern):
destpath = mozpath.join('..', files_entry['base'], leaf_filename)
mode = entry['external_attr'] >> 16
writer.add(destpath.encode('utf-8'), reader[filename], mode=mode)

if not added_entry:
raise ValueError('Archive format changed! No pattern from "{patterns}"'
Expand Down

0 comments on commit 44791f9

Please sign in to comment.