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_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_automerge_action_exists(py_recipe, jinja_env): cfg = copy.deepcopy(py_recipe.config) cnfgr_fdstk.copy_feedstock_content(cfg, py_recipe.recipe) assert os.path.exists( os.path.join(py_recipe.recipe, ".github/workflows/automerge.yml")) with open(os.path.join(py_recipe.recipe, ".github/workflows/automerge.yml")) as f: action_config = yaml.safe_load(f) assert "jobs" in action_config assert "automerge-action" in action_config["jobs"]
def test_webservices_action_exists(py_recipe, jinja_env): cnfgr_fdstk.copy_feedstock_content(py_recipe.config, py_recipe.recipe) assert os.path.exists( os.path.join(py_recipe.recipe, ".github/workflows/webservices.yml")) with open( os.path.join(py_recipe.recipe, ".github/workflows/webservices.yml")) as f: action_config = yaml.safe_load(f) assert "jobs" in action_config assert "webservices" in action_config["jobs"]
def test_automerge_action_noton(py_recipe, jinja_env): cfg = copy.deepcopy(py_recipe.config) cfg["bot"]["automerge"] = False cnfgr_fdstk.copy_feedstock_content(cfg, py_recipe.recipe) cnfgr_fdstk.render_actions( jinja_env=jinja_env, forge_config=cfg, forge_dir=py_recipe.recipe, ) assert not os.path.exists( os.path.join(py_recipe.recipe, ".github/workflows/main.yml") )
def test_files_skip_render(render_skipped_recipe, jinja_env): cnfgr_fdstk.render_README( jinja_env=jinja_env, forge_config=render_skipped_recipe.config, forge_dir=render_skipped_recipe.recipe, ) cnfgr_fdstk.copy_feedstock_content(render_skipped_recipe.config, render_skipped_recipe.recipe) skipped_files = [ ".gitignore", ".gitattributes", "README.md", "LICENSE.txt" ] for f in skipped_files: fpath = os.path.join(render_skipped_recipe.recipe, f) assert not os.path.exists(fpath)
def test_automerge_action_exists(py_recipe, jinja_env): cfg = copy.deepcopy(py_recipe.config) cfg["bot"]["automerge"] = True cnfgr_fdstk.copy_feedstock_content(cfg, py_recipe.recipe) cnfgr_fdstk.render_actions( jinja_env=jinja_env, forge_config=cfg, forge_dir=py_recipe.recipe, ) assert os.path.exists( os.path.join(py_recipe.recipe, ".github/workflows/main.yml") ) with open( os.path.join(py_recipe.recipe, ".github/workflows/main.yml") ) as f: action_config = yaml.safe_load(f) assert "jobs" in action_config assert "regro-cf-autotick-bot-action" in action_config["jobs"]