Skip to content

Commit

Permalink
Add 'real' use case tests that currently fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Nov 1, 2023
1 parent 2f88e60 commit 273b388
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/integration/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,36 @@ def test_lpad(fw_lpad):


@pytest.mark.parametrize("worker", ["test_local_worker", "test_remote_worker"])
def test_submit_flow(runner, fw_lpad, worker):
def test_submit_flow(fw_lpad, worker):
from jobflow import Flow

from jobflow_remote import submit_flow
from jobflow_remote.testing import add
from jobflow_remote.jobs.runner import Runner

count = fw_lpad.get_fw_ids(count_only=True)
count = fw_lpad.get_fw_ids({"state": "COMPLETED"}, count_only=True)

add_first = add(1, 5)
add_second = add(add_first.output, 5)

flow = Flow([add_first, add_second])
submit_flow(flow, worker=worker)

new_count = fw_lpad.get_fw_ids(count_only=True)
runner = Runner()
runner.tick_delay = 0.2
runner.run(ticks=100)

new_count = fw_lpad.get_fw_ids({"state": "COMPLETED"}, count_only=True)
assert new_count == count + 2


@pytest.mark.parametrize("worker", ["test_local_worker", "test_remote_worker"])
def test_submit_flow_with_dependencies(runner, fw_lpad, worker):
def test_submit_flow_with_dependencies(fw_lpad, worker):
from jobflow import Flow

from jobflow_remote import submit_flow
from jobflow_remote.testing import add, write_file
from jobflow_remote.jobs.runner import Runner

count = fw_lpad.get_fw_ids(count_only=True)
add_parent_1 = add(1, 1)
Expand All @@ -78,5 +83,9 @@ def test_submit_flow_with_dependencies(runner, fw_lpad, worker):
flow = Flow([add_parent_1, add_parent_2, add_children, write])
submit_flow(flow, worker=worker)

runner = Runner()
runner.tick_delay = 0.2
runner.run(ticks=10)

new_count = fw_lpad.get_fw_ids(count_only=True)
assert new_count == count + 4

0 comments on commit 273b388

Please sign in to comment.