Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion antarest/service_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def build_output_storage_list(config: Config, file_output_storage: InStudyFileOu
if not config.storage.output.enable:
return [file_output_storage]
tmp_dir = config.storage.tmp_dir / "outputs"
lfs = DirLargeFileStorage(config.storage.archive_dir)
lfs = DirLargeFileStorage(config.storage.output.archive_dir)
v2_storage = V2OutputStorage(tmp_dir=tmp_dir, archive_storage=lfs, repository=OutputV2Repository())

if config.storage.output.default:
Expand Down
11 changes: 10 additions & 1 deletion tests/integration/output/test_v2_output_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#
# This file is part of the Antares project.
import io
import os
import zipfile
from pathlib import Path

Expand Down Expand Up @@ -177,10 +178,18 @@ def test_delete_study_linked_to_output(admin_client: TestClient, study_id: str)
assert res.status_code == 200


def test_archive_and_unarchive(admin_client: TestClient, study_id: str, output_name: str) -> None:
def test_archive_and_unarchive(admin_client: TestClient, study_id: str, output_name: str, tmp_path: Path) -> None:
"""Test archiving and unarchiving a V2 output."""
client = admin_client

output_archives_dir = tmp_path / "output_archives"

# Check the archive is already present in the expected dir
# Checks an implementation detail, but allows to verify the config is correcly taken into account
files = os.listdir(output_archives_dir)
assert len(files) == 1
assert files[0] == f"{study_id}-{output_name}"

# Verify not archived initially
res = client.get(f"/v1/studies/{study_id}/outputs")
v2_output = next(o for o in res.json() if o["name"] == output_name)
Expand Down
Loading