diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index 71c59457fb..db8f43dad7 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -23,7 +23,7 @@ jobs: container: image: nvcr.io/nvidia/pytorch:21.06-py3 # CUDA 11.3 options: --gpus all - runs-on: [self-hosted, linux, x64, common] + runs-on: [self-hosted, linux, x64, integration] steps: - uses: actions/checkout@v3 - name: cache weekly timestamp diff --git a/environment-dev.yml b/environment-dev.yml index 1f1d9c773f..1b91cb38fc 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -9,7 +9,7 @@ dependencies: - coverage>=5.5 - parameterized - setuptools>=50.3.0,!=60.0.0 - - ignite==0.4.8 + - ignite==0.4.10 - gdown>=4.4.0 - scipy - nibabel diff --git a/tests/min_tests.py b/tests/min_tests.py index 026514e29e..439d95db5f 100644 --- a/tests/min_tests.py +++ b/tests/min_tests.py @@ -29,7 +29,6 @@ def run_testsuit(): exclude_cases = [ # these cases use external dependencies "test_ahnet", "test_arraydataset", - "test_auto3dseg_autorunner", "test_auto3dseg_ensemble", "test_auto3dseg_hpo", "test_auto3dseg", @@ -107,6 +106,7 @@ def run_testsuit(): "test_integration_workflows", "test_integration_workflows_gan", "test_integration_bundle_run", + "test_integration_autorunner", "test_invert", "test_invertd", "test_iterable_dataset", diff --git a/tests/test_auto3dseg_autorunner.py b/tests/test_integration_autorunner.py similarity index 100% rename from tests/test_auto3dseg_autorunner.py rename to tests/test_integration_autorunner.py diff --git a/tests/test_masked_inference_wsi_dataset.py b/tests/test_masked_inference_wsi_dataset.py index 661f728e47..c424edd897 100644 --- a/tests/test_masked_inference_wsi_dataset.py +++ b/tests/test_masked_inference_wsi_dataset.py @@ -10,6 +10,7 @@ # limitations under the License. import os +import tempfile import unittest from unittest import skipUnless @@ -30,23 +31,21 @@ FILE_NAME = f"temp_{base_name}" FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", FILE_NAME + extension) -MASK1 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask1.npy") -MASK2 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask2.npy") -MASK4 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask4.npy") +MASK1, MASK2, MASK4 = "mask1.npy", "mask2.npy", "mask4.npy" HEIGHT = 32914 WIDTH = 46000 -def prepare_data(): +def prepare_data(*masks): mask = np.zeros((HEIGHT // 2, WIDTH // 2)) mask[100, 100] = 1 - np.save(MASK1, mask) + np.save(masks[0], mask) mask[100, 101] = 1 - np.save(MASK2, mask) + np.save(masks[1], mask) mask[100:102, 100:102] = 1 - np.save(MASK4, mask) + np.save(masks[2], mask) TEST_CASE_0 = [ @@ -156,17 +155,24 @@ def prepare_data(): ] +@skip_if_quick class TestMaskedInferenceWSIDataset(unittest.TestCase): def setUp(self): - prepare_data() + self.base_dir = tempfile.TemporaryDirectory() + prepare_data(*[os.path.join(self.base_dir.name, m) for m in [MASK1, MASK2, MASK4]]) hash_type = testing_data_config("images", FILE_KEY, "hash_type") hash_val = testing_data_config("images", FILE_KEY, "hash_val") download_url_or_skip_test(FILE_URL, FILE_PATH, hash_type=hash_type, hash_val=hash_val) + def tearDown(self): + self.base_dir.cleanup() + @parameterized.expand([TEST_CASE_0, TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4]) @skipUnless(has_cim, "Requires CuCIM") @skip_if_quick def test_read_patches_cucim(self, input_parameters, expected): + for m in input_parameters["data"]: + m["mask"] = os.path.join(self.base_dir.name, m["mask"]) dataset = MaskedInferenceWSIDataset(**input_parameters) self.compare_samples_expected(dataset, expected) @@ -174,6 +180,8 @@ def test_read_patches_cucim(self, input_parameters, expected): @skipUnless(has_osl, "Requires OpenSlide") @skip_if_quick def test_read_patches_openslide(self, input_parameters, expected): + for m in input_parameters["data"]: + m["mask"] = os.path.join(self.base_dir.name, m["mask"]) dataset = MaskedInferenceWSIDataset(**input_parameters) self.compare_samples_expected(dataset, expected)