Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
annshress committed Nov 6, 2023
1 parent 17a7bdf commit 40024c7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,8 @@ tags
# prefect artifacts
.prefectignore

# test assets
test/input_files/*/Assets/*

# Dask
dask-worker-space/
2 changes: 1 addition & 1 deletion helper_scripts/hedwig_reg_listen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi

# start worker specific to THAT venv
WFLOWS="$HEDWIG_HOME/image_portal_workflows/em_workflows"
WORKPOOL=default-pool
WORKPOOL=workpool

if [[ $ACTION == "listen" ]]; then
printf "\nStarting $HEDWIG_ENV Worker\n"
Expand Down
4 changes: 2 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def _mock_bioformats_gen_zarr(file_path: FilePath, *a, **kw):
monkeypatch.setattr(ng, "bioformats_gen_zarr", _mock_bioformats_gen_zarr)


@pytest.fixture
def prefect_test():
@pytest.fixture(autouse=True, scope="session")
def prefect_test_fixture():
"""
Reference: https://docs.prefect.io/2.13.5/guides/testing/
"""
Expand Down
1 change: 1 addition & 0 deletions test/input_files/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*jpeg filter=lfs diff=lfs merge=lfs -text
*jpg filter=lfs diff=lfs merge=lfs -text
*.mrc filter=lfs diff=lfs merge=lfs -text
*.czi filter=lfs diff=lfs merge=lfs -text
14 changes: 7 additions & 7 deletions test/test_czi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def test_no_mount_point_flow_fails(mock_binaries, monkeypatch, caplog):

monkeypatch.setattr(config, "NFS_MOUNT", _mock_NFS_MOUNT)

state = czi_flow(
file_share=share_name,
input_dir="test/input_files/IF_czi/Projects/smaller",
no_api=True,
)
assert not state.is_successful()
with pytest.raises(RuntimeError):
czi_flow(
file_share=share_name,
input_dir="test/input_files/IF_czi/Projects/smaller",
no_api=True,
)
assert f"{share_name} doesn't exist. Failing!" in caplog.text, caplog.text


Expand All @@ -66,7 +66,7 @@ def test_czi_workflow_callback_structure(
"""
from em_workflows.czi.flow import czi_flow

input_dir = "test/input_files/IF_czi/Projects/smaller"
input_dir = "test/input_files/IF_czi/Projects/Cropped_Image"
if not Path(input_dir).exists():
pytest.skip("Missing input files")

Expand Down
3 changes: 3 additions & 0 deletions test/test_dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_dm4_conv(mock_nfs_mount):
file_share="test",
input_dir="/test/input_files/dm_inputs/Projects/Lab/PI",
no_api=True,
return_state=True,
)
assert state.is_completed()

Expand All @@ -29,6 +30,7 @@ def test_dm4_conv_clean_workdir(mock_nfs_mount):
file_name="20210525_1416_A000_G000.dm4",
no_api=True,
keep_workdir=False,
return_state=True,
)
assert state.is_completed()
# keep_workdir = False removes the workdir
Expand All @@ -41,6 +43,7 @@ def test_dm4_conv_clean_workdir(mock_nfs_mount):
file_name="20210525_1416_A000_G000.dm4",
no_api=True,
keep_workdir=True,
return_state=True,
)
assert state.is_completed()
# keep_workdir keeps the workdir
Expand Down

0 comments on commit 40024c7

Please sign in to comment.