diff options
Diffstat (limited to 'WebKitTools/BuildSlaveSupport')
-rw-r--r-- | WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json | 3 | ||||
-rw-r--r-- | WebKitTools/BuildSlaveSupport/test-result-archive | 42 |
2 files changed, 39 insertions, 6 deletions
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json index f4b0822..eda05f1 100644 --- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json +++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json @@ -14,6 +14,7 @@ { "name": "apple-macpro-1", "platform": "mac-snowleopard" }, { "name": "apple-macpro-2", "platform": "mac-snowleopard" }, { "name": "apple-macpro-3", "platform": "mac-snowleopard" }, + { "name": "apple-macpro-4", "platform": "mac-leopard" }, { "name": "apple-windows-1", "platform": "win"}, { "name": "apple-windows-2", "platform": "win"}, @@ -51,7 +52,7 @@ }, { "name": "Leopard Intel Release (Tests)", "type": "Test", "builddir": "leopard-intel-release-tests", "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"], - "slavenames": ["apple-pixel-1", "test-slave"] + "slavenames": ["apple-macpro-4", "apple-pixel-1", "test-slave"] }, { "name": "Leopard Intel Debug (Build)", "type": "Build", "builddir": "leopard-intel-debug", diff --git a/WebKitTools/BuildSlaveSupport/test-result-archive b/WebKitTools/BuildSlaveSupport/test-result-archive index df02dbd..af66bf0 100644 --- a/WebKitTools/BuildSlaveSupport/test-result-archive +++ b/WebKitTools/BuildSlaveSupport/test-result-archive @@ -23,10 +23,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import optparse, os, shutil, subprocess, sys +import optparse, os, shutil, subprocess, sys, zipfile sourceRootDirectory = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) -layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory, "layout-test-results")) archiveFile = os.path.join(sourceRootDirectory, "layout-test-results.zip") def main(): @@ -43,9 +42,16 @@ def main(): if action not in ('archive'): parser.error("Action is required") - return archiveTestResults(options.configuration, options.platform) + layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory, "layout-test-results")) + if options.platform == 'chromium': + # See results_directory() in webkitpy/layout_tests/port/chromium.py. + layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory, + "WebKit", "chromium", "webkit", options.configuration.capitalize(), + "layout-test-results")) -def archiveTestResults(configuration, platform): + return archiveTestResults(options.configuration, options.platform, layoutTestResultsDir) + +def archiveTestResults(configuration, platform, layoutTestResultsDir): assert platform in ('mac', 'win', 'gtk', 'qt', 'chromium') try: @@ -66,9 +72,14 @@ def archiveTestResults(configuration, platform): if platform == 'mac': if subprocess.call(["ditto", "-c", "-k", "--sequesterRsrc", layoutTestResultsDir, archiveFile]): return 1 - elif platform in ('win', 'gtk', 'qt', 'chromium'): + elif platform in ('win', 'gtk', 'qt'): if subprocess.call(["zip", "-r", archiveFile, "."], cwd=layoutTestResultsDir): return 1 + elif platform == 'chromium': + cwd = os.getcwd() + os.chdir(layoutTestResultsDir) + zipFilesRecursively(archiveFile, ["."]) + os.chdir(cwd) try: shutil.rmtree(layoutTestResultsDir) @@ -82,5 +93,26 @@ def archiveTestResults(configuration, platform): if e.errno != 90: raise +def zipFilesRecursively(archiveFile, files): + """Make a zip archive. + + Args: + archiveFile: The resultant zip archive file name. + files: A list of files to be archived. If a list item is a directory, + files in the directory are archived recursively.""" + zipper = zipfile.ZipFile(archiveFile, 'w', zipfile.ZIP_DEFLATED) + for file in files: + if os.path.isdir(file): + for dirPath, dirNames, fileNames in os.walk(file): + for fileName in fileNames: + relativePath = os.path.join(dirPath, fileName) + print "Adding", relativePath + zipper.write(relativePath) + else: + print "Adding", file + zipper.write(file) + zipper.close() + print "Created zip archive: ", archiveFile + if __name__ == '__main__': sys.exit(main()) |