fix(cli): preflight Docker for --push-to builds and keep the push token out of verbose output

This commit is contained in:
Hugo Durand
2026-09-18 15:07:03 -04:00
parent 4c412e4c94
commit d590afbc3b
7 changed files with 63 additions and 11 deletions
@@ -692,6 +692,14 @@ class TestSelectSource:
assert _select_source(**{**self.OPTIONS, **flags}) == expected
def test_push_to_build_requires_local_docker(self, monkeypatch):
monkeypatch.setattr(
deploy_mod, "can_build_locally", lambda: (False, "Docker is required")
)
with pytest.raises(click.UsageError, match="Docker is required"):
_select_source(**{**self.OPTIONS, "push_to": self.REPOSITORY})
@pytest.mark.parametrize(
("flags", "message"),
[
@@ -717,7 +725,9 @@ class TestSelectSource:
),
],
)
def test_conflicting_flags_are_rejected(self, flags, message):
def test_conflicting_flags_are_rejected(self, monkeypatch, flags, message):
monkeypatch.setattr(deploy_mod, "can_build_locally", lambda: (True, None))
with pytest.raises(click.UsageError, match=message):
_select_source(**{**self.OPTIONS, **flags})