Skip to content

Commit

Permalink
Include stages file to mlcube download tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aristizabal95 committed Oct 25, 2024
1 parent 4a146d3 commit 39cd511
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/medperf/tests/entities/test_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def set_common_attributes(self, setup):
self.cube_path, config.additional_path, config.tarball_filename
)
self.img_path = os.path.join(self.cube_path, config.image_path, "img.tar.gz")
self.config_files_paths = [self.manifest_path, self.params_path]
self.stages_path = os.path.join(self.cube_path, config.stages_filename)
self.config_files_paths = [self.manifest_path, self.params_path, self.stages_path]
self.run_files_paths = [self.add_path, self.img_path]

@pytest.mark.parametrize("setup", [{"remote": [DEFAULT_CUBE]}], indirect=True)
Expand Down
5 changes: 5 additions & 0 deletions cli/medperf/tests/entities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,21 @@ def setup_cube_comms_downloads(mocker, fs):
add_file = config.tarball_filename
img_path = config.image_path
img_file = "img.tar.gz"
stages_path = ""
stages_file = config.stages_filename

get_cube_fn = generate_cubefile_fn(fs, cube_path, cube_file)
get_params_fn = generate_cubefile_fn(fs, params_path, params_file)
get_add_fn = generate_cubefile_fn(fs, add_path, add_file)
get_img_fn = generate_cubefile_fn(fs, img_path, img_file)
get_stages_fn = generate_cubefile_fn(fs, stages_path, stages_file)


mocker.patch(PATCH_RESOURCES.format("get_cube"), side_effect=get_cube_fn)
mocker.patch(PATCH_RESOURCES.format("get_cube_params"), side_effect=get_params_fn)
mocker.patch(PATCH_RESOURCES.format("get_cube_additional"), side_effect=get_add_fn)
mocker.patch(PATCH_RESOURCES.format("get_cube_image"), side_effect=get_img_fn)
mocker.patch(PATCH_RESOURCES.format("get_cube_stages"), side_effect=get_stages_fn)


# Setup Dataset
Expand Down
2 changes: 2 additions & 0 deletions cli/medperf/tests/mocks/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ class TestCube(Cube):
"https://test.com/additional_files.tar.gz"
)
additional_files_tarball_hash: Optional[str] = EMPTY_FILE_HASH
stages_url: Optional[str] = "https://test.com/stages.yaml"
stages_hash: Optional[str] = EMPTY_FILE_HASH
state: str = "OPERATION"
is_valid = True

0 comments on commit 39cd511

Please sign in to comment.