Skip to content

Commit 1b0a6ff

Browse files
authored
Merge pull request #2786 from regro/pipes
BUG make sure to capture low-level stdout too
2 parents 6096444 + 749e0a9 commit 1b0a6ff

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

docker/run_bot_task.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from contextlib import contextmanager, redirect_stdout
2626

2727
import click
28+
import wurlitzer
2829

2930
existing_feedstock_node_attrs_option = click.option(
3031
"--existing-feedstock-node-attrs",
@@ -153,7 +154,7 @@ def _provide_source_code():
153154
output_source_code = "/cf_tick_dir/source_dir"
154155
os.makedirs(output_source_code, exist_ok=True)
155156

156-
with provide_source_code_local(recipe_dir) as cb_work_dir:
157+
with wurlitzer.pipes(), provide_source_code_local(recipe_dir) as cb_work_dir:
157158
chmod_plus_rwX(cb_work_dir, recursive=True, skip_on_error=True)
158159
sync_dirs(
159160
cb_work_dir, output_source_code, ignore_dot_git=True, update_git=False

tests/test_container_tasks.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,37 @@ def test_container_tasks_provide_source_code_containerized(use_containers):
507507
assert "pyproject.toml" in os.listdir(source_dir)
508508

509509

510+
@pytest.mark.skipif(
511+
not (HAVE_CONTAINERS and HAVE_TEST_IMAGE), reason="containers not available"
512+
)
513+
def test_container_tasks_provide_source_code_containerized_patches(use_containers):
514+
with (
515+
tempfile.TemporaryDirectory() as tmpdir,
516+
pushd(tmpdir),
517+
):
518+
subprocess.run(
519+
[
520+
"git",
521+
"clone",
522+
"https://github.com/conda-forge/tiledb-feedstock.git",
523+
]
524+
)
525+
with pushd("tiledb-feedstock"):
526+
subprocess.run(
527+
[
528+
"git",
529+
"checkout",
530+
"2.23.x",
531+
]
532+
)
533+
534+
with provide_source_code_containerized("tiledb-feedstock/recipe") as source_dir:
535+
assert os.path.exists(source_dir)
536+
assert os.path.isdir(source_dir)
537+
assert "tiledb" in os.listdir(source_dir)
538+
assert "CMakeLists.txt" in os.listdir(source_dir)
539+
540+
510541
@pytest.mark.skipif(
511542
not (HAVE_CONTAINERS and HAVE_TEST_IMAGE), reason="containers not available"
512543
)

0 commit comments

Comments
 (0)