Skip to content

Commit

Permalink
Expose -r in pyflyte run (#1933)
Browse files Browse the repository at this point in the history
* Expose -r in pyflyte run

Signed-off-by: Eduardo Apolinario <[email protected]>

* Lint

Signed-off-by: Eduardo Apolinario <[email protected]>

---------

Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario and eapolinario authored Nov 9, 2023
1 parent e4ed7ec commit c7c8289
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class RunLevelParams(PyFlyteParams):
)
remote: bool = make_field(
click.Option(
param_decls=["--remote"],
param_decls=["-r", "--remote"],
required=False,
is_flag=True,
default=False,
Expand Down
13 changes: 11 additions & 2 deletions tests/flytekit/unit/cli/pyflyte/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,20 @@ def remote():
return flyte_remote


def test_pyflyte_run_wf(remote):
@pytest.mark.parametrize(
"remote_flag",
[
"-r",
"--remote",
],
)
def test_pyflyte_run_wf(remote, remote_flag):
with mock.patch("flytekit.clis.sdk_in_container.helpers.get_remote"):
runner = CliRunner()
module_path = WORKFLOW_FILE
result = runner.invoke(pyflyte.main, ["run", module_path, "my_wf", "--help"], catch_exceptions=False)
result = runner.invoke(
pyflyte.main, ["run", remote_flag, module_path, "my_wf", "--help"], catch_exceptions=False
)

assert result.exit_code == 0

Expand Down

0 comments on commit c7c8289

Please sign in to comment.