diff --git a/.gitignore b/.gitignore index a227ecc9..8f2df5ef 100644 --- a/.gitignore +++ b/.gitignore @@ -148,5 +148,8 @@ tags # prefect artifacts .prefectignore +# test assets +test/input_files/*/Assets/* + # Dask dask-worker-space/ diff --git a/helper_scripts/hedwig_reg_listen.sh b/helper_scripts/hedwig_reg_listen.sh index 828b70d6..3e96d419 100755 --- a/helper_scripts/hedwig_reg_listen.sh +++ b/helper_scripts/hedwig_reg_listen.sh @@ -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" diff --git a/test/conftest.py b/test/conftest.py index 2da6ff1b..17f7f165 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -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/ """ diff --git a/test/input_files/.gitattributes b/test/input_files/.gitattributes index 0af86750..3d984658 100644 --- a/test/input_files/.gitattributes +++ b/test/input_files/.gitattributes @@ -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 diff --git a/test/test_czi.py b/test/test_czi.py index fe657960..ba225c18 100644 --- a/test/test_czi.py +++ b/test/test_czi.py @@ -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 @@ -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") diff --git a/test/test_dm.py b/test/test_dm.py index 59d3ffc3..66fc376d 100644 --- a/test/test_dm.py +++ b/test/test_dm.py @@ -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() @@ -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 @@ -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