Skip to content

Commit

Permalink
feat: live logs for mulled build (#939)
Browse files Browse the repository at this point in the history
Enable live logs for mulled-test.

The `--disable-live-logs` option was added in
#930 but was only for the
build. This will enable live logs for the mulled test.


Draft because it still needs testing.
  • Loading branch information
aliciaaevans authored Nov 25, 2023
1 parent 2c5d4ad commit 7f83d7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ def build(recipe: str, pkg_paths: List[str] = None,
for pkg_path in pkg_paths:
try:
pkg_test.test_package(pkg_path, base_image=base_image,
conda_image=mulled_conda_image)
conda_image=mulled_conda_image,
live_logs=live_logs)
except sp.CalledProcessError:
logger.error('TEST FAILED: %s', recipe)
return BuildResult(False, None)
Expand Down
6 changes: 5 additions & 1 deletion bioconda_utils/pkg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def test_package(
mulled_args="",
base_image=None,
conda_image=MULLED_CONDA_IMAGE,
live_logs = True,
):
"""
Tests a built package in a minimal docker container.
Expand Down Expand Up @@ -119,6 +120,9 @@ def test_package(
conda_image : None | str
Conda Docker image to install the package with during the mulled based
tests.
live_logs : True | bool
If True, enable live logging during the build process
"""

assert path.endswith('.tar.bz2'), "Unrecognized path {0}".format(path)
Expand Down Expand Up @@ -173,6 +177,6 @@ def test_package(
env["CONDA_IMAGE"] = conda_image
with tempfile.TemporaryDirectory() as d:
with utils.Progress():
p = utils.run(cmd, env=env, cwd=d, mask=False)
p = utils.run(cmd, env=env, cwd=d, mask=False, live=live_logs)

return p

0 comments on commit 7f83d7f

Please sign in to comment.