diff --git a/src/lando/api/tests/test_landings.py b/src/lando/api/tests/test_landings.py index 745bf729..dcd54826 100644 --- a/src/lando/api/tests/test_landings.py +++ b/src/lando/api/tests/test_landings.py @@ -321,6 +321,7 @@ def test_integrated_execute_job( revisions = [ create_patch_revision(number, **kwargs) for number, kwargs in revisions_params ] + job_params = { "status": LandingJobStatus.IN_PROGRESS, "requester_email": "test@example.com", diff --git a/src/lando/main/tests/conftest.py b/src/lando/main/tests/conftest.py index 8900acfb..b8b383c2 100644 --- a/src/lando/main/tests/conftest.py +++ b/src/lando/main/tests/conftest.py @@ -8,6 +8,7 @@ def git_repo_seed(request) -> Path: return Path(__file__).parent / "data" / "test-repo.patch" + @pytest.fixture def git_repo(tmp_path: Path, git_repo_seed: Path) -> Path: """ @@ -23,6 +24,7 @@ def git_repo(tmp_path: Path, git_repo_seed: Path) -> Path: subprocess.run(["git", "init", repo_dir], check=True) subprocess.run(["git", "branch", "-m", "main"], check=True, cwd=repo_dir) _git_setup_user(repo_dir) + _git_ignore_denyCurrentBranch(repo_dir) subprocess.run(["git", "am", str(git_repo_seed)], check=True, cwd=repo_dir) subprocess.run(["git", "show"], check=True, cwd=repo_dir) subprocess.run(["git", "branch"], check=True, cwd=repo_dir) @@ -42,3 +44,16 @@ def _git_setup_user(repo_dir: Path): check=True, cwd=repo_dir, ) + + +def _git_ignore_denyCurrentBranch(repo_dir: Path): + """Disable error when pushing to this non-bare repo. + + This is a sane protection in general, but it gets in the way of the tests here, + where we just want a target, and don't care much about the final state of this + target after everything is done.""" + subprocess.run( + ["git", "config", "receive.denyCurrentBranch", "ignore"], + check=True, + cwd=repo_dir, + )