feat: enhance service discovery and proxy management

This commit is contained in:
gabdevele
2026-05-05 13:57:46 +02:00 Unverified
parent 93ba8e9ac2
commit a523c2faa3
53 changed files with 3206 additions and 706 deletions
@@ -0,0 +1,50 @@
from pathlib import Path
from integrations.docker.compose import get_all_services_in_dir
def test_get_all_services_in_dir_scans_immediate_children(tmp_path: Path):
root = tmp_path / "workspace"
project = root / "playground"
project.mkdir(parents=True)
(project / "docker-compose.yml").write_text(
"""
services:
echo:
image: hashicorp/http-echo:1.0
ports:
- "9081:5678"
""".strip(),
encoding="utf-8",
)
services = get_all_services_in_dir(root)
assert services == [
{
"name": "echo",
"ports": [9081],
"bindings": [{"published": 9081, "host": None}],
"folder": project,
}
]
def test_get_all_services_in_dir_skips_nested_grandchildren(tmp_path: Path):
root = tmp_path / "workspace"
nested = root / "group" / "playground"
nested.mkdir(parents=True)
(nested / "docker-compose.yml").write_text(
"""
services:
echo:
image: hashicorp/http-echo:1.0
ports:
- "9081:5678"
""".strip(),
encoding="utf-8",
)
services = get_all_services_in_dir(root)
assert services == []