From d877faaafa850ce37839b7e288be0607309f097d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 1 Sep 2015 20:39:51 -0700 Subject: [PATCH] Run unit test on Travis with a prebuilt sky_shell --- engine/src/flutter/.travis.yml | 4 -- .../flutter/sky/tools/download_sky_shell.py | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100755 engine/src/flutter/sky/tools/download_sky_shell.py diff --git a/engine/src/flutter/.travis.yml b/engine/src/flutter/.travis.yml index 113994f524..6ec335b69b 100644 --- a/engine/src/flutter/.travis.yml +++ b/engine/src/flutter/.travis.yml @@ -1,10 +1,6 @@ language: cpp -sudo: required before_install: - ./travis/before_install.sh before_script: - ./travis/setup.sh - - export PATH=$PWD/depot_tools:$PATH - - export BOTO_CONFIG=$PWD/boto - - cd src script: ./travis/build.sh diff --git a/engine/src/flutter/sky/tools/download_sky_shell.py b/engine/src/flutter/sky/tools/download_sky_shell.py new file mode 100755 index 0000000000..e1e258c1f7 --- /dev/null +++ b/engine/src/flutter/sky/tools/download_sky_shell.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import argparse +import os +import subprocess +import sys + +def download(base_url, out_dir, name): + url = '%s/%s' % (base_url, name) + dst = os.path.join(out_dir, name) + print 'Downloading', url + subprocess.call([ 'curl', '-o', dst, url ]) + +def main(): + parser = argparse.ArgumentParser(description='Downloads sky_shell from Google storage') + parser.add_argument('revision_file') + parser.add_argument('out_dir') + args = parser.parse_args() + + out_dir = args.out_dir + if not os.path.exists(out_dir): + os.makedirs(out_dir) + + revision = None + with open(args.revision_file, 'r') as f: + revision = f.read() + + base_url = 'https://storage.googleapis.com/mojo/sky/shell/linux-x64/%s' % revision + download(base_url, out_dir, 'sky_shell') + download(base_url, out_dir, 'icudtl.dat') + download(base_url, out_dir, 'sky_snapshot') + +if __name__ == '__main__': + sys.exit(main())