def test_new_submodules(testing_new_submodules): """Test that c3i recognizes new submodules with recipes. The conda-env-feedstock is a new submodule that contains a recipe while the docker-images submodule does not include a recipe. """ new_submodules = compute_build_graph.git_changed_recipes() assert 'conda-env-feedstock' in new_submodules assert 'docker-images' not in new_submodules
def test_submodules_renaming(testing_submodule_commit): """Test that c3i recognizes submodules with changes or new names. The conda-feedstock submodule was set to a different revision and the conda-build-feedstock was renamed to cb3-feedstock. """ changed = compute_build_graph.git_changed_recipes('HEAD') assert 'conda-feedstock' in changed assert 'cb3-feedstock' in changed assert 'conda-build-feedstock' not in changed
def test_git_changed_recipes_earlier_rev(testing_submodules_repo): assert set(compute_build_graph.git_changed_recipes( 'HEAD@{1}', 'HEAD@{2}')) == set( ('conda-feedstock', 'conda-build-feedstock'))
def test_git_changed_recipes_rev_range(testing_submodule_commit): assert set(compute_build_graph.git_changed_recipes( 'HEAD@{3}', 'HEAD')) == set( ('conda-build-all-feedstock', 'conda-feedstock', 'cb3-feedstock'))
def test_git_changed_recipes_head(testing_submodules_repo): assert set(compute_build_graph.git_changed_recipes('HEAD')) == set( ['conda-build-all-feedstock'])