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

Unified Diff: scripts/slave/recipe_modules/goma/example.py

Issue 2480193002: Stop to use contextmanager for goma.build_with_goma (Closed)
Patch Set: fix pylint Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/goma/example.py
diff --git a/scripts/slave/recipe_modules/goma/example.py b/scripts/slave/recipe_modules/goma/example.py
index 134b782f3569d6a0942db321f8cd55a2a8ce0e09..b516c59e7c38b1571f62258f69ab5075c3a7274c 100644
--- a/scripts/slave/recipe_modules/goma/example.py
+++ b/scripts/slave/recipe_modules/goma/example.py
@@ -24,19 +24,16 @@ def RunSteps(api):
with api.goma.build_with_goma(
ninja_log_outdir=api.properties.get('ninja_log_outdir'),
ninja_log_compiler=api.properties.get('ninja_log_compiler'),
- ninja_log_command=command,
+ ninja_command=command,
allow_build_without_goma=allow_build_without_goma,
- env=env):
- if 'GOMA_DISABLED' in env:
- api.goma.remove_j_flag(command)
- api.step('ninja', command, env=env)
- else:
- # build something using goma.
- api.step('echo goma jobs',
- ['echo', str(api.goma.recommended_goma_jobs)])
- api.step('echo goma jobs second',
- ['echo', str(api.goma.recommended_goma_jobs)])
- api.step('ninja', command, env=env)
+ env=env) as (env_update, ninja_command):
+ env.update(env_update)
+ # build something using goma.
+ api.step('echo goma jobs',
+ ['echo', str(api.goma.recommended_goma_jobs)])
+ api.step('echo goma jobs second',
+ ['echo', str(api.goma.recommended_goma_jobs)])
+ api.step('ninja', ninja_command, env=env)
def GenTests(api):
for platform in ('linux', 'win', 'mac'):
@@ -45,7 +42,7 @@ def GenTests(api):
'mastername': 'test_master',
'slavename': 'test_slave',
'clobber': '1',
- 'build_command': ['ninja', '-C', 'out/Release', '-j', '500'],
+ 'build_command': ['ninja', '-C', 'out/Release'],
'ninja_log_outdir': 'out/Release',
'ninja_log_compiler': 'goma',
'build_data_dir': 'build_data_dir',

Powered by Google App Engine
This is Rietveld 408576698