Пример #1
0
def test_python_build_matrix_expansion(monkeypatch):
    monkeypatch.chdir(test_data_dir)
    tasks = execute.collect_tasks('.',
                                  matrix_base_dir=os.path.join(
                                      test_data_dir, 'linux-config-test'),
                                  folders=['python_test'])
    assert len(tasks.nodes()) == 2
    assert 'frank-1.0-python_2.7-on-centos5-64' in tasks.nodes()
    assert 'frank-1.0-python_3.6-on-centos5-64' in tasks.nodes()
Пример #2
0
def test_collapse_with_win_matrix_and_subpackages(monkeypatch):
    monkeypatch.chdir(test_data_dir)
    tasks = execute.collect_tasks(
        '.',
        matrix_base_dir=os.path.join(test_data_dir, 'config-win'),
        folders=['win_split_outputs_compiler_reduction'])
    # 8 subpackages, but 4 total builds - 2 subpackages per build
    assert len(tasks.nodes()) == 4
    assert 'postgresql-split-10.1-c_compiler_vs2008-on-win-64' in tasks.nodes()
    assert 'postgresql-split-10.1-c_compiler_vs2015-on-win-64' in tasks.nodes()
    assert 'postgresql-split-10.1-c_compiler_vs2008-target_win-32-on-win-64' in tasks.nodes(
    )
    assert 'postgresql-split-10.1-c_compiler_vs2015-target_win-32-on-win-64' in tasks.nodes(
    )
Пример #3
0
def test_dependency_with_selector_cross_compile(testing_conda_resolve):
    g = execute.collect_tasks(
        test_data_dir, ['selector_run', 'functools32-feedstock'],
        matrix_base_dir=os.path.join(test_data_dir, 'config-win'),
        variant_config_files=os.path.join(test_data_dir,
                                          'conda_build_config.yaml'))
    assert len(g.nodes()) == 6
    # native edge
    assert ('test_run_deps_with_selector-1.0-python_2.7-on-win-64',
            'functools32-3.2.3.2-python_2.7-on-win-64') in g.edges()
    # cross edge
    assert (
        'test_run_deps_with_selector-1.0-python_2.7-target_win-32-on-win-64',
        'functools32-3.2.3.2-python_2.7-target_win-32-on-win-64') in g.edges()
Пример #4
0
def test_collect_tasks(mocker, testing_conda_resolve, testing_graph):
    mocker.patch.object(execute, 'Resolve')
    mocker.patch.object(execute, 'get_build_index')
    mocker.patch.object(conda_concourse_ci.compute_build_graph, '_installable')
    execute.Resolve.return_value = testing_conda_resolve
    conda_concourse_ci.compute_build_graph._installable.return_value = True
    task_graph = execute.collect_tasks(graph_data_dir,
                                       folders=['a'],
                                       matrix_base_dir=test_config_dir)
    build_platforms = os.listdir(
        os.path.join(test_config_dir, 'build_platforms.d'))
    # one build, one test per platform, uploads only for builds.
    n_platforms = len(build_platforms)
    # minimum args means build and test provided folders.  Two tasks.
    assert len(task_graph.nodes()) == n_platforms
Пример #5
0
def test_collapse_noarch_python():
    path = os.path.join(test_data_dir, 'noarch_python_recipes')
    folders = ['pkg_a', 'pkg_b']
    variant_file = os.path.join(test_data_dir, 'noarch_python_recipes',
                                'conda_build_config.yaml')
    tasks = execute.collect_tasks(path,
                                  folders,
                                  matrix_base_dir=test_config_dir,
                                  variant_config_files=variant_file)
    # 9 nodes,
    # * 1 for the noarch: python pkg_a build on centos5-64
    # * 2 for the noarch: python pkg_a tests on osx-109 and win-32
    # * 6 for pkg_b (3 platforms x 2 python version)
    print(tasks.nodes())
    assert len(tasks.nodes()) == 9
    assert 'pkg_a-1.0.0-on-centos5-64' in tasks.nodes()
    assert 'test-pkg_a-1.0.0-on-osx-109' in tasks.nodes()
    assert 'test-pkg_a-1.0.0-on-win-32' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_3.6-on-osx-109' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_2.7-on-osx-109' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_3.6-on-win-32' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_2.7-on-win-32' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_3.6-on-centos5-64' in tasks.nodes()
    assert 'pkg_b-1.0.0-python_2.7-on-centos5-64' in tasks.nodes()
    # test nodes should be labeled as such
    assert tasks.node['test-pkg_a-1.0.0-on-osx-109']['test_only'] == True
    assert tasks.node['test-pkg_a-1.0.0-on-win-32']['test_only'] == True
    # 8 edges
    # * 6 pkg_b nodes have an edge to the pkg_a build node
    # * 2 pkg_a tests nodes with edges to the pkg_a build_node
    print(tasks.edges())
    assert len(tasks.edges()) == 8
    a_build_node = 'pkg_a-1.0.0-on-centos5-64'
    assert ('test-pkg_a-1.0.0-on-osx-109', a_build_node) in tasks.edges()
    assert ('test-pkg_a-1.0.0-on-win-32', a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_3.6-on-osx-109', a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_2.7-on-osx-109', a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_3.6-on-win-32', a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_2.7-on-win-32', a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_3.6-on-centos5-64',
            a_build_node) in tasks.edges()
    assert ('pkg_b-1.0.0-python_2.7-on-centos5-64',
            a_build_node) in tasks.edges()
Пример #6
0
def test_subpackage_matrix_no_subpackages(monkeypatch):
    """Subpackages should not constitute new entries in the build graph.  They should be lumped in
    with their parent recipe.  However, we have to include them initially for the sake of
    dependency ordering.  Thus we initially include them as though they were full packages, but
    then we squish them together and re-assign and dependency edges."""
    monkeypatch.chdir(test_data_dir)
    tasks = execute.collect_tasks(
        '.',
        matrix_base_dir=os.path.join(test_data_dir, 'linux-config-test'),
        folders=['has_subpackages', 'depends_on_subpackage'])
    assert len(tasks.nodes()) == 2
    assert 'has_subpackages_toplevel-1.0-on-centos5-64' in tasks.nodes()
    assert 'depends_on_subpackage-1.0-on-centos5-64' in tasks.nodes()
    assert 'has_subpackages_subpackage-1.0-on-centos5-64' not in tasks.nodes()
    # this is the actual dependency
    assert (
        'depends_on_subpackage-1.0-on-centos5-64',
        'has_subpackages_subpackage-1.0-on-centos5-64') not in tasks.edges()
    # this is what we remap it to
    assert ('depends_on_subpackage-1.0-on-centos5-64',
            'has_subpackages_toplevel-1.0-on-centos5-64') in tasks.edges()