Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test: clarify container boundaries for storage and Redis (#40714)

Asuka Minato3a0acfedbb01
diff --git a/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py b/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py
index 7ffefc1b566..cfc52dca3d6 100644
--- a/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py
+++ b/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py
@@ -3,9 +3,13 @@
import json
from uuid import uuid4
+import pytest
+
from extensions.ext_redis import redis_client
from services.enterprise.account_deletion_sync import _queue_task
+pytestmark = pytest.mark.usefixtures("set_up_containers_and_env")
+
def test_queue_task_success() -> None:
workspace_id = str(uuid4())
diff --git a/api/tests/test_containers_integration_tests/test_opendal_fs_default_root.py b/api/tests/unit_tests/extensions/storage/test_opendal_fs_default_root_behavior.py
similarity index 91%
rename from api/tests/test_containers_integration_tests/test_opendal_fs_default_root.py
rename to api/tests/unit_tests/extensions/storage/test_opendal_fs_default_root_behavior.py
index 6365207661c..2782b30c60b 100644
--- a/api/tests/test_containers_integration_tests/test_opendal_fs_default_root.py
+++ b/api/tests/unit_tests/extensions/storage/test_opendal_fs_default_root_behavior.py
@@ -1,3 +1,5 @@
+"""Unit coverage for OpenDAL filesystem root selection."""
+
from pathlib import Path
import pytest
@@ -8,7 +10,7 @@ from extensions.storage.opendal_storage import OpenDALStorage
class TestOpenDALFsDefaultRoot:
"""Test that OpenDALStorage with scheme='fs' works correctly when no root is provided."""
- def test_fs_without_root_uses_default(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
+ def test_fs_without_root_uses_default(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""When no root is specified, the default 'storage' should be used and passed to the Operator."""
# Change to tmp_path so the default "storage" dir is created there
monkeypatch.chdir(tmp_path)
@@ -27,7 +29,7 @@ class TestOpenDALFsDefaultRoot:
# Cleanup
storage.delete("test_default_root.txt")
- def test_fs_with_explicit_root(self, tmp_path: Path):
+ def test_fs_with_explicit_root(self, tmp_path: Path) -> None:
"""When root is explicitly provided, it should be used."""
custom_root = str(tmp_path / "custom_storage")
storage = OpenDALStorage(scheme="fs", root=custom_root)
@@ -40,7 +42,7 @@ class TestOpenDALFsDefaultRoot:
# Cleanup
storage.delete("test_explicit_root.txt")
- def test_fs_with_env_var_root(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
+ def test_fs_with_env_var_root(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""When OPENDAL_FS_ROOT env var is set, it should be picked up via _get_opendal_kwargs."""
env_root = str(tmp_path / "env_storage")
monkeypatch.setenv("OPENDAL_FS_ROOT", env_root)