Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: success check does not consider pkg_dir #836 #838

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
11 changes: 9 additions & 2 deletions bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import subprocess as sp
from collections import defaultdict, namedtuple
import os
import logging
import itertools
import logging
import os
import sys
import time

from typing import List, Optional
Expand Down Expand Up @@ -138,6 +139,12 @@ def build(recipe: str, pkg_paths: List[str] = None,
env=whitelisted_env,
noarch=is_noarch)
# Use presence of expected packages to check for success
if (docker_builder.pkg_dir is not None):
platform = utils.RepoData.native_platform()
subfolder = utils.RepoData.platform2subdir(platform)
conda_build_config = utils.load_conda_build_config(platform=subfolder)
pkg_paths = [p.replace(conda_build_config.output_folder, docker_builder.pkg_dir) for p in pkg_paths]

for pkg_path in pkg_paths:
if not os.path.exists(pkg_path):
logger.error(
Expand Down
24 changes: 24 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,30 @@ def test_single_build_only(single_build):
assert os.path.exists(pkg)


@pytest.mark.skipif(SKIP_DOCKER_TESTS, reason='skipping on osx')
@pytest.mark.long_running_2
def test_single_build_pkg_dir(recipes_fixture):
"""
Builds the "one" recipe with pkg_dir.
"""
logger.error("Making recipe builder")
docker_builder = docker_utils.RecipeBuilder(
use_host_conda_bld=True,
pkg_dir=os.getcwd() + "/output",
docker_base_image=DOCKER_BASE_IMAGE)
mulled_test = False
logger.error("DONE")
logger.error("Fixture: Building 'one' within docker with pkg_dir")
res = build.build(
recipe=recipes_fixture.recipe_dirs['one'],
pkg_paths=recipes_fixture.pkgs['one'],
docker_builder=docker_builder,
mulled_test=mulled_test,
)
logger.error("Fixture: Building 'one' within docker and pkg_dir -- DONE")
assert res.success


@pytest.mark.skipif(SKIP_DOCKER_TESTS, reason='skipping on osx')
def test_single_build_with_post_test(single_build):
for pkg in single_build:
Expand Down
Loading