Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: scripts/slave/recipes/flutter/flutter.py

Issue 1748403005: add a basic integration test for Flutter (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: retrain the recipes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/flutter/flutter.expected/mac.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 6
7 DEPS = [ 7 DEPS = [
8 'depot_tools/git', 8 'depot_tools/git',
9 'file', 9 'file',
10 'gsutil', 10 'gsutil',
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 api.step('test %s' % path, ['flutter', 'test'], cwd=checkout.join(path)) 47 api.step('test %s' % path, ['flutter', 'test'], cwd=checkout.join(path))
48 48
49 _pub_test('packages/cassowary') 49 _pub_test('packages/cassowary')
50 _flutter_test('packages/flutter') 50 _flutter_test('packages/flutter')
51 _pub_test('packages/flutter_tools') 51 _pub_test('packages/flutter_tools')
52 _pub_test('packages/flx') 52 _pub_test('packages/flx')
53 _pub_test('packages/newton') 53 _pub_test('packages/newton')
54 54
55 _flutter_test('examples/stocks') 55 _flutter_test('examples/stocks')
56 56
57 def TestCreateAndLaunch(api):
58 with MakeTempDir(api) as temp_dir:
59 api.step('test create', ['flutter', 'create', '--with-driver-test',
60 'sample_app'], cwd=temp_dir)
61 app_path = temp_dir.join('sample_app')
62 api.step('drive sample_app', ['flutter', 'drive'], cwd=app_path)
57 63
58 # TODO(eseidel): Would be nice to have this on api.path or api.file. 64 # TODO(eseidel): Would be nice to have this on api.path or api.file.
59 @contextlib.contextmanager 65 @contextlib.contextmanager
60 def MakeTempDir(api): 66 def MakeTempDir(api):
61 try: 67 try:
62 temp_dir = api.path.mkdtemp('tmp') 68 temp_dir = api.path.mkdtemp('tmp')
63 yield temp_dir 69 yield temp_dir
64 finally: 70 finally:
65 api.file.rmtree('temp dir', temp_dir) 71 api.file.rmtree('temp dir', temp_dir)
66 72
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 156
151 # The context adds dart-sdk tools to PATH sets PUB_CACHE. 157 # The context adds dart-sdk tools to PATH sets PUB_CACHE.
152 with api.step.context({'env': env}): 158 with api.step.context({'env': env}):
153 # Must be first to download dependencies for later steps. 159 # Must be first to download dependencies for later steps.
154 api.step('flutter doctor', ['flutter', 'doctor']) 160 api.step('flutter doctor', ['flutter', 'doctor'])
155 api.step('update packages', ['flutter', 'update-packages']) 161 api.step('update packages', ['flutter', 'update-packages'])
156 AnalyzeFlutter(api) 162 AnalyzeFlutter(api)
157 TestFlutterPackagesAndExamples(api) 163 TestFlutterPackagesAndExamples(api)
158 BuildExamples(api, git_hash) 164 BuildExamples(api, git_hash)
159 165
166 # TODO(yjbanov): we do not yet have Android devices hooked up, nor do we
167 # support the Android emulator. For now, only run on iOS Simulator.
168 if api.platform.is_mac:
169 TestCreateAndLaunch(api)
170
160 # TODO(eseidel): We only want to generate one copy of the docs at a time 171 # TODO(eseidel): We only want to generate one copy of the docs at a time
161 # otherwise multiple rsyncs could race, causing badness. We'll eventually 172 # otherwise multiple rsyncs could race, causing badness. We'll eventually
162 # need both a lock on the bucket, as well as some assurance that we're 173 # need both a lock on the bucket, as well as some assurance that we're
163 # always moving the docs forward. Possibly by using a separate builder. 174 # always moving the docs forward. Possibly by using a separate builder.
164 # Until then, only generate on linux to reduce the chance of race. 175 # Until then, only generate on linux to reduce the chance of race.
165 if api.platform.is_linux: 176 if api.platform.is_linux:
166 # TODO(eseidel): Is there a way for GenerateDocs to read PUB_CACHE from 177 # TODO(eseidel): Is there a way for GenerateDocs to read PUB_CACHE from
167 # the env instead of me passing it in? 178 # the env instead of me passing it in?
168 GenerateDocs(api, pub_cache) 179 GenerateDocs(api, pub_cache)
169 180
170 181
171 def GenTests(api): 182 def GenTests(api):
172 for platform in ('mac', 'linux'): 183 for platform in ('mac', 'linux'):
173 yield (api.test(platform) + api.platform(platform, 64) + 184 yield (api.test(platform) + api.platform(platform, 64) +
174 api.properties(clobber='')) 185 api.properties(clobber=''))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/flutter/flutter.expected/mac.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698