Exemplo n.º 1
0
def test_pkg_test_conda_image():
    """
    Running a mulled-build test with a non-default conda image.
    """
    # Inspects the installing conda version by writing $PREFIX/conda-version as
    # a post-link step -- but only if we are actually doing mulled tests, i.e.,
    # when $PREFIX == /usr/local.
    conda_version = '4.9.2'
    recipe = dedent(f"""
        one:
          meta.yaml: |
            package:
              name: one
              version: 0.1
            test:
              commands:
                - '[[ "${{PREFIX}}" != /usr/local ]] || cat /usr/local/conda-version'
                - '[[ "${{PREFIX}}" != /usr/local ]] || grep -F ''conda {conda_version}'' /usr/local/conda-version'
          post-link.sh: |
            #!/bin/bash
            if [[ "${{PREFIX}}" == /usr/local ]] ; then
                /opt/*/bin/conda --version > /usr/local/conda-version
            fi
    """)  # noqa: E501: line too long
    built_packages = _build_pkg(recipe)
    for pkg in built_packages:
        pkg_test.test_package(
            pkg,
            conda_image=f"quay.io/bioconda/create-env:1.0.1-{conda_version}")
Exemplo n.º 2
0
def test_pkg_test_conda_image():
    """
    Running a mulled-build test with a non-default conda image.
    """
    # Inspects the installing conda version by writing $PREFIX/conda-version as
    # a post-link step -- but only if we are actually doing mulled tests, i.e.,
    # when $PREFIX == /usr/local.
    recipe = dedent("""
        one:
          meta.yaml: |
            package:
              name: one
              version: 0.1
            test:
              commands:
                - '[ "${PREFIX}" != /usr/local ] || cat /usr/local/conda-version'
                - '[ "${PREFIX}" != /usr/local ] || grep -F ''conda 4.3.11'' /usr/local/conda-version'
          post-link.sh: |
            #!/bin/bash
            if [ "${PREFIX}" == /usr/local ] ; then
                /opt/conda/bin/conda --version > /usr/local/conda-version
            fi
    """)
    build_package = _build_pkg(recipe)
    pkg_test.test_package(build_package,
                          conda_image="continuumio/miniconda3:4.3.11")
Exemplo n.º 3
0
def test_pkg_test_custom_base_image():
    """
    Running a mulled-build test with a custom base image.
    """
    built_packages = _build_pkg(RECIPE_CUSTOM_BASE)
    for pkg in built_packages:
        pkg_test.test_package(pkg, base_image='debian:latest')
Exemplo n.º 4
0
def test_pkg_test():
    """
    Running a mulled-build test shouldn't cause any errors.
    """
    built_packages = _build_pkg(RECIPE_ONE)
    for pkg in built_packages:
        pkg_test.test_package(pkg)
Exemplo n.º 5
0
def test_pkg_test_conda_image():
    """
    Running a mulled-build test with a non-default conda image.
    """
    # Inspects the installing conda version by writing $PREFIX/conda-version as
    # a post-link step -- but only if we are actually doing mulled tests, i.e.,
    # when $PREFIX == /usr/local.
    recipe = dedent("""
        one:
          meta.yaml: |
            package:
              name: one
              version: 0.1
            test:
              commands:
                - '[ "${PREFIX}" != /usr/local ] || cat /usr/local/conda-version'
                - '[ "${PREFIX}" != /usr/local ] || grep -F ''conda 4.3.11'' /usr/local/conda-version'
          post-link.sh: |
            #!/bin/bash
            if [ "${PREFIX}" == /usr/local ] ; then
                /opt/conda/bin/conda --version > /usr/local/conda-version
            fi
    """)  # noqa: E501: line too long
    built_packages = _build_pkg(recipe)
    for pkg in built_packages:
        pkg_test.test_package(pkg, conda_image="continuumio/miniconda3:4.3.11")
Exemplo n.º 6
0
def test_pkg_test_custom_base_image():
    """
    Running a mulled-build test with a custom base image.
    """
    built_packages = _build_pkg(RECIPE_CUSTOM_BASE)
    for pkg in built_packages:
        pkg_test.test_package(pkg, base_image='debian:latest')
Exemplo n.º 7
0
def test_pkg_test():
    """
    Running a mulled-build test shouldn't cause any errors.
    """
    built_packages = _build_pkg(RECIPE_ONE)
    for pkg in built_packages:
        pkg_test.test_package(pkg)
Exemplo n.º 8
0
def test_pkg_test_mulled_build_error():
    """
    Make sure calling mulled-build with the wrong arg fails correctly.
    """
    built_packages = _build_pkg(RECIPE_ONE)
    with pytest.raises(sp.CalledProcessError):
        for pkg in built_packages:
            pkg_test.test_package(pkg, mulled_args='--wrong-arg')
Exemplo n.º 9
0
def test_pkg_test_mulled_build_error():
    """
    Make sure calling mulled-build with the wrong arg fails correctly.
    """
    built_packages = _build_pkg(RECIPE_ONE)
    with pytest.raises(sp.CalledProcessError):
        for pkg in built_packages:
            pkg_test.test_package(pkg, mulled_args='--wrong-arg')
Exemplo n.º 10
0
def test_pkg_test_mulled_build_error():
    """
    Make sure calling mulled-build with the wrong arg fails correctly
    """
    built_package = _build_pkg()
    with pytest.raises(sp.CalledProcessError):
        res = pkg_test.test_package(built_package, mulled_args='--wrong-arg')
Exemplo n.º 11
0
def test_single_build_with_post_test(single_build):
    for pkg in single_build:
        pkg_test.test_package(pkg)
Exemplo n.º 12
0
def test_single_build_with_post_test(single_build):
    pkg_test.test_package(single_build)
Exemplo n.º 13
0
def test_pkg_test():
    """
    Running a mulled-build test shouldn't cause any errors
    """
    built_package = _build_pkg()
    res = pkg_test.test_package(built_package)
Exemplo n.º 14
0
def test_single_build_with_post_test(single_build):
    for pkg in single_build:
        pkg_test.test_package(pkg)