async def test_download_file(): store_root = set_store() path = os.path.join(store_root, "foo") check_or_create_path(path, is_dir=True) create_tmp_files(path) await download_file(subpath="foo/0", check_cache=False) path_to = os.path.join(settings.AGENT_CONFIG.artifacts_root, "foo/0") assert os.path.exists(path_to)
def setUp(self): super().setUp() self.store_root = set_store() self.run_path = os.path.join(self.store_root, "uuid") # Create run artifacts path and some files create_path(self.run_path) create_tmp_files(self.run_path) self.client = get_streams_client() self.base_url = STREAMS_URL + "/namespace/owner/project/runs/uuid/artifacts"
async def test_delete_file(): store_root = set_store() path = os.path.join(store_root, "foo") check_or_create_path(path, is_dir=True) create_tmp_files(path) filepath = "{}/0".format(path) assert os.path.exists(path) is True assert os.path.exists(filepath) is True await delete_file(subpath="foo/0") assert os.path.exists(path) is True assert os.path.exists(filepath) is False
def setUp(self): super().setUp() self.store_root = set_store() settings.AGENT_CONFIG.notification_connections = [ V1ConnectionType( name="slack", kind=V1ConnectionKind.SLACK, secret=V1K8sResourceSchema(name="some"), ) ] self.client = get_streams_client() self.base_url = STREAMS_URL + "/namespace/owner/project/runs/uuid/notify"
async def test_download_dir_archive(): store_root = set_store() path = os.path.join(store_root, "foo") check_or_create_path(path, is_dir=True) create_tmp_files(path) await download_dir(subpath="foo", to_tar=True) path_to = os.path.join(settings.AGENT_CONFIG.artifacts_root, "foo") assert os.path.exists(path_to) assert os.path.exists(path_to + "/0") assert os.path.exists(path_to + "/1") tar_path = os.path.join(settings.CLIENT_CONFIG.archive_root, "foo.tar.gz") assert os.path.exists(tar_path)
def setUp(self): super().setUp() self.store_root = set_store() self.run_path = os.path.join(self.store_root, "uuid") self.run_events = os.path.join(self.run_path, "events") # Create run artifacts path create_path(self.run_path) # Create run artifacts events path create_path(self.run_events) # Create run events self.create_tmp_events() self.client = get_streams_client() self.base_url = STREAMS_URL + "/namespace/owner/project/runs/uuid/events"
def setUp(self): super().setUp() set_store() self.client = get_streams_client()