def test_circle_skipped(linux_skipped_recipe, jinja_env):
    forge_dir = linux_skipped_recipe.recipe
    circle_osx_file = os.path.join(forge_dir, ".scripts", "run_osx_build.sh")
    circle_linux_file = os.path.join(forge_dir, ".scripts",
                                     "run_docker_build.sh")
    circle_config_file = os.path.join(forge_dir, ".circleci", "config.yml")

    config = copy.deepcopy(linux_skipped_recipe.config)
    cnfgr_fdstk.copy_feedstock_content(config, forge_dir)
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env,
        forge_config=linux_skipped_recipe.config,
        forge_dir=forge_dir,
    )
    assert not os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)

    config["provider"]["osx"] = "circle"

    cnfgr_fdstk.copy_feedstock_content(config, forge_dir)
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=config,
                              forge_dir=forge_dir)
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
Esempio n. 2
0
def test_circle_with_yum_reqs(py_recipe, jinja_env):
    with open(os.path.join(py_recipe.recipe, 'recipe', 'yum_requirements.txt'),
              'w') as f:
        f.write('nano\n')
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=py_recipe.config,
                              forge_dir=py_recipe.recipe)
Esempio n. 3
0
def test_circle_skipped(linux_skipped_recipe, jinja_env):
    forge_dir = linux_skipped_recipe.recipe
    circle_osx_file = os.path.join(forge_dir, '.circleci', 'run_osx_build.sh')
    circle_linux_file = os.path.join(forge_dir, '.circleci',
                                     'run_docker_build.sh')
    circle_config_file = os.path.join(forge_dir, '.circleci', 'config.yml')

    cnfgr_fdstk.copy_feedstock_content(forge_dir)
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=linux_skipped_recipe.config,
                              forge_dir=forge_dir)
    assert not os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)

    config = copy.deepcopy(linux_skipped_recipe.config)
    config['provider']['osx'] = 'circle'

    cnfgr_fdstk.copy_feedstock_content(forge_dir)
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=config,
                              forge_dir=forge_dir)
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
def test_circle_with_yum_reqs(py_recipe, jinja_env):
    with open(os.path.join(py_recipe.recipe, "recipe", "yum_requirements.txt"),
              "w") as f:
        f.write("nano\n")
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=py_recipe.config,
                              forge_dir=py_recipe.recipe)
def test_circle_skipped(linux_skipped_recipe, jinja_env):
    forge_dir = linux_skipped_recipe.recipe
    circle_osx_file = os.path.join(forge_dir, ".circleci", "run_osx_build.sh")
    circle_linux_file = os.path.join(
        forge_dir, ".circleci", "run_docker_build.sh"
    )
    circle_config_file = os.path.join(forge_dir, ".circleci", "config.yml")

    cnfgr_fdstk.copy_feedstock_content(forge_dir)
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env,
        forge_config=linux_skipped_recipe.config,
        forge_dir=forge_dir,
    )
    assert not os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)

    config = copy.deepcopy(linux_skipped_recipe.config)
    config["provider"]["osx"] = "circle"

    cnfgr_fdstk.copy_feedstock_content(forge_dir)
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
Esempio n. 6
0
def test_circle_with_empty_yum_reqs_raises(py_recipe, jinja_env):
    with open(os.path.join(py_recipe.recipe, 'recipe', 'yum_requirements.txt'),
              'w') as f:
        f.write('# effectively empty')
    with pytest.raises(ValueError):
        cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                                  forge_config=py_recipe.config,
                                  forge_dir=py_recipe.recipe)
def test_circle_with_yum_reqs(py_recipe, jinja_env):
    with open(
        os.path.join(py_recipe.recipe, "recipe", "yum_requirements.txt"), "w"
    ) as f:
        f.write("nano\n")
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env,
        forge_config=py_recipe.config,
        forge_dir=py_recipe.recipe,
    )
def test_circle_with_empty_yum_reqs_raises(py_recipe, jinja_env):
    with open(
        os.path.join(py_recipe.recipe, "recipe", "yum_requirements.txt"), "w"
    ) as f:
        f.write("# effectively empty")
    with pytest.raises(ValueError):
        cnfgr_fdstk.render_circle(
            jinja_env=jinja_env,
            forge_config=py_recipe.config,
            forge_dir=py_recipe.recipe,
        )
def test_circle_with_empty_yum_reqs_raises(py_recipe, jinja_env):
    py_recipe.config["provider"]["linux"] = "circle"

    with open(os.path.join(py_recipe.recipe, "recipe", "yum_requirements.txt"),
              "w") as f:
        f.write("# effectively empty")
    with pytest.raises(ValueError):
        cnfgr_fdstk.render_circle(
            jinja_env=jinja_env,
            forge_config=py_recipe.config,
            forge_dir=py_recipe.recipe,
        )
Esempio n. 10
0
def test_r_matrix_on_circle(r_recipe, jinja_env):
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=r_recipe.config,
                              forge_dir=r_recipe.recipe)
    # this configuration should be run
    assert r_recipe.config['circle']['enabled']
    # no appveyor.yaml should have been written.  Nothing else, either, since we only ran
    #     appveyor render.  No matrix dir should exist.
    matrix_dir = os.path.join(r_recipe.recipe, '.ci_support')
    assert os.path.isdir(matrix_dir)
    # single matrix entry - readme is generated later in main function
    assert len(os.listdir(matrix_dir)) == 2
def test_r_matrix_on_circle(r_recipe, jinja_env):
    r_recipe.config["provider"]["linux"] = "circle"

    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=r_recipe.config,
                              forge_dir=r_recipe.recipe)
    # this configuration should be run
    assert r_recipe.config["circle"]["enabled"]
    matrix_dir = os.path.join(r_recipe.recipe, ".ci_support")
    assert os.path.isdir(matrix_dir)
    # single matrix entry - readme is generated later in main function
    assert len(os.listdir(matrix_dir)) == 2
def test_py_matrix_on_circle(py_recipe, jinja_env):
    py_recipe.config["provider"]["linux"] = "circle"

    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=py_recipe.config,
                              forge_dir=py_recipe.recipe)
    # this configuration should be run
    assert py_recipe.config["circle"]["enabled"]
    # no appveyor.yaml should have been written.  Nothing else, either, since we only ran
    #     appveyor render.  No matrix dir should exist.
    matrix_dir = os.path.join(py_recipe.recipe, ".ci_support")
    assert os.path.isdir(matrix_dir)
    # single matrix entry - readme is generated later in main function
    assert len(os.listdir(matrix_dir)) == 2
def test_r_matrix_on_circle(r_recipe, jinja_env):
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env,
        forge_config=r_recipe.config,
        forge_dir=r_recipe.recipe,
    )
    # this configuration should be run
    assert r_recipe.config["circle"]["enabled"]
    # no appveyor.yaml should have been written.  Nothing else, either, since we only ran
    #     appveyor render.  No matrix dir should exist.
    matrix_dir = os.path.join(r_recipe.recipe, ".ci_support")
    assert os.path.isdir(matrix_dir)
    # single matrix entry - readme is generated later in main function
    assert len(os.listdir(matrix_dir)) == 2
def test_circle_osx(py_recipe, jinja_env):
    # Set legacy providers
    py_recipe.config["provider"]["osx"] = "travis"
    py_recipe.config["provider"]["linux"] = "circle"

    forge_dir = py_recipe.recipe
    travis_yml_file = os.path.join(forge_dir, ".travis.yml")
    circle_osx_file = os.path.join(forge_dir, ".scripts", "run_osx_build.sh")
    circle_linux_file = os.path.join(
        forge_dir, ".scripts", "run_docker_build.sh"
    )
    circle_config_file = os.path.join(forge_dir, ".circleci", "config.yml")

    cnfgr_fdstk.clear_scripts(forge_dir)
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=py_recipe.config, forge_dir=forge_dir
    )
    assert not os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(
        jinja_env=jinja_env, forge_config=py_recipe.config, forge_dir=forge_dir
    )
    assert os.path.exists(travis_yml_file)

    cnfgr_fdstk.clear_scripts(forge_dir)
    config = copy.deepcopy(py_recipe.config)
    config["provider"]["osx"] = "circle"
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert not os.path.exists(travis_yml_file)

    cnfgr_fdstk.clear_scripts(forge_dir)
    config = copy.deepcopy(py_recipe.config)
    config["provider"]["linux"] = "dummy"
    config["provider"]["osx"] = "circle"
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
def test_circle_osx(py_recipe, jinja_env):
    forge_dir = py_recipe.recipe
    travis_yml_file = os.path.join(forge_dir, ".travis.yml")
    circle_osx_file = os.path.join(forge_dir, ".circleci", "run_osx_build.sh")
    circle_linux_file = os.path.join(
        forge_dir, ".circleci", "run_docker_build.sh"
    )
    circle_config_file = os.path.join(forge_dir, ".circleci", "config.yml")

    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=py_recipe.config, forge_dir=forge_dir
    )
    assert not os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(
        jinja_env=jinja_env, forge_config=py_recipe.config, forge_dir=forge_dir
    )
    assert os.path.exists(travis_yml_file)

    config = copy.deepcopy(py_recipe.config)
    config["provider"]["osx"] = "circle"
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert not os.path.exists(travis_yml_file)

    config = copy.deepcopy(py_recipe.config)
    config["provider"]["linux"] = "dummy"
    config["provider"]["osx"] = "circle"
    cnfgr_fdstk.render_circle(
        jinja_env=jinja_env, forge_config=config, forge_dir=forge_dir
    )
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
Esempio n. 16
0
def test_circle_osx(py_recipe, jinja_env):
    forge_dir = py_recipe.recipe
    travis_yml_file = os.path.join(forge_dir, '.travis.yml')
    circle_osx_file = os.path.join(forge_dir, '.circleci', 'run_osx_build.sh')
    circle_linux_file = os.path.join(forge_dir, '.circleci',
                                     'run_docker_build.sh')
    circle_config_file = os.path.join(forge_dir, '.circleci', 'config.yml')

    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=py_recipe.config,
                              forge_dir=forge_dir)
    assert not os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(jinja_env=jinja_env,
                              forge_config=py_recipe.config,
                              forge_dir=forge_dir)
    assert os.path.exists(travis_yml_file)

    config = copy.deepcopy(py_recipe.config)
    config['provider']['osx'] = 'circle'
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=config,
                              forge_dir=forge_dir)
    assert os.path.exists(circle_osx_file)
    assert os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)
    cnfgr_fdstk.render_travis(jinja_env=jinja_env,
                              forge_config=config,
                              forge_dir=forge_dir)
    assert not os.path.exists(travis_yml_file)

    config = copy.deepcopy(py_recipe.config)
    config['provider']['linux'] = 'dummy'
    config['provider']['osx'] = 'circle'
    cnfgr_fdstk.render_circle(jinja_env=jinja_env,
                              forge_config=config,
                              forge_dir=forge_dir)
    assert os.path.exists(circle_osx_file)
    assert not os.path.exists(circle_linux_file)
    assert os.path.exists(circle_config_file)