コード例 #1
0
def test_expand_run_build_non_installable_prereq(mocker,
                                                 testing_conda_resolve):
    mocker.patch.object(compute_build_graph, '_installable')
    compute_build_graph._installable.return_value = False
    g = compute_build_graph.construct_graph(
        graph_data_dir,
        dummy_worker,
        folders=('b', ),
        run='build',
        matrix_base_dir=test_config_dir,
        conda_resolve=testing_conda_resolve)

    compute_build_graph.expand_run(g,
                                   Config(),
                                   testing_conda_resolve,
                                   run='build',
                                   worker=dummy_worker,
                                   recipes_dir=graph_data_dir)
    assert set(g.nodes()) == {'a-1.0-on-linux', 'b-1.0-on-linux'}

    compute_build_graph.expand_run(g,
                                   Config(),
                                   testing_conda_resolve,
                                   run='build',
                                   worker=dummy_worker,
                                   recipes_dir=graph_data_dir,
                                   matrix_base_dir=test_config_dir,
                                   steps=1)
    assert set(
        g.nodes()) == {'a-1.0-on-linux', 'b-1.0-on-linux', 'c-1.0-on-linux'}
コード例 #2
0
def test_expand_run_all_steps_down(mocker, testing_graph,
                                   testing_conda_resolve):
    """
    Should build/test/upload all of the recipes.
    Start with B
    B depends on A, so build A
    Step down the tree from B to C
    Step down the tree from C to D
    Step down the tree from D to E
    """
    mocker.patch.object(compute_build_graph, '_installable')
    compute_build_graph._installable.return_value = False
    g = compute_build_graph.construct_graph(
        graph_data_dir,
        dummy_worker,
        folders=('b', ),
        run='build',
        matrix_base_dir=test_config_dir,
        conda_resolve=testing_conda_resolve)

    compute_build_graph.expand_run(g,
                                   Config(),
                                   testing_conda_resolve,
                                   run='build',
                                   worker=dummy_worker,
                                   recipes_dir=graph_data_dir,
                                   matrix_base_dir=test_config_dir,
                                   max_downstream=-1,
                                   steps=-1)
    assert set(g.nodes()) == {
        'a-1.0-on-linux', 'b-1.0-on-linux', 'c-1.0-on-linux', 'd-1.0-on-linux',
        'e-1.0-on-linux'
    }
コード例 #3
0
def test_expand_run_no_up_or_down(mocker, testing_graph,
                                  testing_conda_resolve):
    initial_length = len(testing_graph)
    # all packages are installable in the default index
    compute_build_graph.expand_run(testing_graph,
                                   Config(),
                                   testing_conda_resolve,
                                   worker=dummy_worker,
                                   run='build')
    assert len(testing_graph) == initial_length
コード例 #4
0
def test_expand_run_two_steps_down(mocker, testing_graph,
                                   testing_conda_resolve):
    mocker.patch.object(compute_build_graph, '_installable')
    compute_build_graph._installable.return_value = False
    # second expansion - one more layer out
    g = compute_build_graph.construct_graph(
        graph_data_dir,
        dummy_worker,
        folders=('a', ),
        run='build',
        matrix_base_dir=test_config_dir,
        conda_resolve=testing_conda_resolve)

    compute_build_graph.expand_run(g,
                                   Config(),
                                   testing_conda_resolve,
                                   run='build',
                                   worker=dummy_worker,
                                   recipes_dir=graph_data_dir,
                                   matrix_base_dir=test_config_dir,
                                   steps=2)
    assert set(
        g.nodes()) == {'a-1.0-on-linux', 'b-1.0-on-linux', 'c-1.0-on-linux'}