Skip to content

Commit

Permalink
kbuild.jinja2: dry_run support
Browse files Browse the repository at this point in the history
If the input node specifies a "dry_run" result in its debug parameters,
skip the building and uploading stages and return the fake result.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
  • Loading branch information
Ricardo Cañuelo committed Jan 29, 2024
1 parent a5bc1d4 commit 8aaa256
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config/runtime/kbuild.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ def main(args):
build.set_storage_config(STORAGE_CONFIG_YAML)
build.write_script("build.sh")
build.serialize("_build.json")
r = os.system("bash -e build.sh")
build2 = KBuild.from_json("_build.json")
build2.verify_build()
results = build2.submit(r)
if NODE.get('debug') and NODE['debug'].get('dry_run'):
retcode = 0 if NODE['debug']['result'] == 'pass' else 1
results = build2.submit(retcode, dry_run=True)
else:
r = os.system("bash -e build.sh")
results = build2.submit(r)
return results

{% endblock %}
Expand Down

0 comments on commit 8aaa256

Please sign in to comment.