Skip to content

Commit

Permalink
refine testing
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Liu <[email protected]>
  • Loading branch information
austin362667 committed Apr 19, 2024
1 parent e4f9a3f commit a2a0cbd
Showing 1 changed file with 39 additions and 31 deletions.
70 changes: 39 additions & 31 deletions flyrs/test_flyte_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,43 @@
remote_py = FlyteRemote(Config.auto(), default_project=PROJECT, default_domain=DOMAIN)
remote_rs = RustFlyteRemote(Config.auto(), default_project=PROJECT, default_domain=DOMAIN)

task_py = remote_py.fetch_task(
project=PROJECT, domain=DOMAIN, name=TASK_NAME, version=VERSION_ID
)
task_rs = remote_rs.fetch_task(
project=PROJECT, domain=DOMAIN, name=TASK_NAME, version=VERSION_ID
)
assert task_py == task_rs

tasks_py = remote_py.list_tasks_by_version(
project=PROJECT, domain=DOMAIN, version=VERSION_ID
)
tasks_rs = remote_rs.list_tasks_by_version(
project=PROJECT, domain=DOMAIN, version=VERSION_ID
)
assert tasks_py == tasks_rs

workflow_py = remote_py.fetch_workflow(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
workflow_rs = remote_rs.fetch_workflow(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
assert workflow_py == workflow_rs

launchplan_py = remote_py.fetch_launch_plan(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
launchplan_rs = remote_rs.fetch_launch_plan(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
assert workflow_py == workflow_rs
## test remote endpoints

def test_fetch_task():
task_py = remote_py.fetch_task(
project=PROJECT, domain=DOMAIN, name=TASK_NAME, version=VERSION_ID
)
task_rs = remote_rs.fetch_task(
project=PROJECT, domain=DOMAIN, name=TASK_NAME, version=VERSION_ID
)
assert task_py == task_rs

def test_list_tasks_by_version():
tasks_py = remote_py.list_tasks_by_version(
project=PROJECT, domain=DOMAIN, version=VERSION_ID
)
tasks_rs = remote_rs.list_tasks_by_version(
project=PROJECT, domain=DOMAIN, version=VERSION_ID
)
assert len(tasks_py)==1
assert len(tasks_rs)==1
assert tasks_py == tasks_rs

def test_fetch_workflow():
workflow_py = remote_py.fetch_workflow(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
workflow_rs = remote_rs.fetch_workflow(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
assert workflow_py == workflow_rs

def test_fetch_launch_plan():
launchplan_py = remote_py.fetch_launch_plan(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
launchplan_rs = remote_rs.fetch_launch_plan(
project=PROJECT, domain=DOMAIN, name=WF_NAME, version=VERSION_ID
)
assert launchplan_py == launchplan_rs

0 comments on commit a2a0cbd

Please sign in to comment.