|
11 | 11 | from ray_release.alerts.handle import result_to_handle_map |
12 | 12 | from ray_release.cluster_manager.cluster_manager import ClusterManager |
13 | 13 | from ray_release.cluster_manager.minimal import MinimalClusterManager |
14 | | -from ray_release.command_runner.command_runner import CommandRunner |
| 14 | +from ray_release.command_runner.anyscale_job_runner import AnyscaleJobRunner |
15 | 15 | from ray_release.exception import ( |
16 | 16 | CommandError, |
17 | 17 | CommandTimeout, |
|
25 | 25 | TestCommandError, |
26 | 26 | TestCommandTimeout, |
27 | 27 | ) |
| 28 | +from ray_release.file_manager.job_file_manager import JobFileManager |
28 | 29 | from ray_release.glue import ( |
29 | 30 | command_runner_to_cluster_manager, |
30 | 31 | run_release_test, |
@@ -123,17 +124,37 @@ def __init__( |
123 | 124 | self.return_dict = this_cluster_manager_return |
124 | 125 | this_instances["cluster_manager"] = self |
125 | 126 |
|
126 | | - class MockCommandRunner(MockReturn, CommandRunner): |
| 127 | + class FakeFileManager(JobFileManager): |
| 128 | + def __init__(self, cluster_manager: ClusterManager): |
| 129 | + super(FakeFileManager, self).__init__(cluster_manager) |
| 130 | + |
| 131 | + def download_from_cloud( |
| 132 | + self, key: str, target: str, delete_after_download: bool = False |
| 133 | + ): |
| 134 | + with open(target, "wt") as f: |
| 135 | + f.write("fake download content") |
| 136 | + |
| 137 | + def delete(self, key: str, recursive: bool = False): |
| 138 | + pass |
| 139 | + |
| 140 | + class MockCommandRunner(MockReturn, AnyscaleJobRunner): |
127 | 141 | return_dict = self.cluster_manager_return |
128 | 142 |
|
129 | 143 | def __init__( |
130 | 144 | self, |
131 | 145 | cluster_manager: ClusterManager, |
| 146 | + file_manager: JobFileManager, |
132 | 147 | working_dir, |
133 | 148 | sdk=None, |
134 | 149 | artifact_path: Optional[str] = None, |
135 | 150 | ): |
136 | | - super(MockCommandRunner, self).__init__(cluster_manager, this_tempdir) |
| 151 | + super(MockCommandRunner, self).__init__( |
| 152 | + cluster_manager, |
| 153 | + FakeFileManager(cluster_manager), |
| 154 | + this_tempdir, |
| 155 | + sdk=this_sdk, |
| 156 | + artifact_path=artifact_path, |
| 157 | + ) |
137 | 158 | self.return_dict = this_command_runner_return |
138 | 159 |
|
139 | 160 | self.mock_alert_return = None |
|
0 commit comments