aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/gcb
diff options
context:
space:
mode:
authorGravatar Max Moroz <mmoroz@chromium.org>2020-02-06 15:44:36 -0800
committerGravatar GitHub <noreply@github.com>2020-02-06 15:44:36 -0800
commit4092bebcb50867fec91096054a46d48a4a8f2237 (patch)
treee08e99f24fb18847d2c802ab5fc158063964f519 /infra/gcb
parentb96d2186aec635d2724f4a5b2d428732e37bede8 (diff)
[infra] Fix broken batching in the corpora download helper (#3351). (#3353)
* [infra] Fix broken batching in the corpora download helper (#3351). * one more
Diffstat (limited to 'infra/gcb')
-rw-r--r--infra/gcb/build_and_run_coverage.py6
-rw-r--r--infra/gcb/build_lib.py12
-rw-r--r--infra/gcb/build_project.py6
3 files changed, 12 insertions, 12 deletions
diff --git a/infra/gcb/build_and_run_coverage.py b/infra/gcb/build_and_run_coverage.py
index 649d5ad8..ec9a548f 100644
--- a/infra/gcb/build_and_run_coverage.py
+++ b/infra/gcb/build_and_run_coverage.py
@@ -132,11 +132,11 @@ def get_build_steps(project_dir):
],
})
- download_corpora_step = build_lib.download_corpora_step(project_name)
- if not download_corpora_step:
+ download_corpora_steps = build_lib.download_corpora_steps(project_name)
+ if not download_corpora_steps:
skip_build("Skipping code coverage build for %s.\n" % project_name)
- build_steps.append(download_corpora_step)
+ build_steps.extend(download_corpora_steps)
failure_msg = ('*' * 80 + '\nCode coverage report generation failed.\n'
'To reproduce, run:\n'
diff --git a/infra/gcb/build_lib.py b/infra/gcb/build_lib.py
index d3508730..23ac8d26 100644
--- a/infra/gcb/build_lib.py
+++ b/infra/gcb/build_lib.py
@@ -98,14 +98,15 @@ def get_signed_url(path, method='PUT', content_type=''):
urllib.urlencode(values))
-def download_corpora_step(project_name):
- """Returns a GCB step for downloading corpora backups for the given project.
+def download_corpora_steps(project_name):
+ """Returns GCB steps for downloading corpora backups for the given project.
"""
fuzz_targets = _get_targets_list(project_name)
if not fuzz_targets:
sys.stderr.write('No fuzz targets found for project "%s".\n' % project_name)
return None
+ steps = []
# Split fuzz targets into batches of CORPUS_DOWNLOAD_BATCH_SIZE.
for i in range(0, len(fuzz_targets), CORPUS_DOWNLOAD_BATCH_SIZE):
download_corpus_args = []
@@ -122,7 +123,7 @@ def download_corpora_step(project_name):
corpus_archive_path = os.path.join('/corpus', binary_name + '.zip')
download_corpus_args.append('%s %s' % (corpus_archive_path, url))
- step = {
+ steps.append({
'name': 'gcr.io/oss-fuzz-base/base-runner',
'entrypoint': 'download_corpus',
'args': download_corpus_args,
@@ -130,5 +131,6 @@ def download_corpora_step(project_name):
'name': 'corpus',
'path': '/corpus'
}],
- }
- return step
+ })
+
+ return steps
diff --git a/infra/gcb/build_project.py b/infra/gcb/build_project.py
index f45b0996..fc1dda11 100644
--- a/infra/gcb/build_project.py
+++ b/infra/gcb/build_project.py
@@ -339,12 +339,10 @@ def get_build_steps(project_dir):
def dataflow_post_build_steps(project_name, env):
- steps = []
- download_corpora_step = build_lib.download_corpora_step(project_name)
- if not download_corpora_step:
+ steps = build_lib.download_corpora_steps(project_name)
+ if not steps:
return None
- steps = [download_corpora_step]
steps.append({
'name': 'gcr.io/oss-fuzz-base/base-runner',
'env': env,