54 lines
2.1 KiB
Python
54 lines
2.1 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class DeploymentEntrypointTests(unittest.TestCase):
|
|
def test_default_container_opens_only_xml_processing_mutation(self) -> None:
|
|
dockerfile = (PROJECT_ROOT / "Dockerfile").read_text(encoding="utf-8")
|
|
commands = [
|
|
json.loads(line.removeprefix("CMD "))
|
|
for line in dockerfile.splitlines()
|
|
if line.startswith("CMD ")
|
|
]
|
|
|
|
self.assertEqual(len(commands), 1)
|
|
command = commands[0]
|
|
self.assertEqual(command[:3], ["python", "-m", "arr_web.run"])
|
|
self.assertIn("--enable-processing", command)
|
|
self.assertNotIn("--enable-monthly-generation", command)
|
|
self.assertNotIn("--enable-company-reports", command)
|
|
self.assertNotIn("--enable-agent-writeback", command)
|
|
self.assertNotIn("requirements-arr-mcp.txt", dockerfile)
|
|
self.assertNotIn("8890", dockerfile)
|
|
|
|
def test_compose_has_no_agent_or_mcp_runtime_surface(self) -> None:
|
|
compose = (PROJECT_ROOT / "compose.yaml").read_text(encoding="utf-8")
|
|
caddy = (PROJECT_ROOT / "deploy" / "Caddyfile").read_text(encoding="utf-8")
|
|
root_requirements = (PROJECT_ROOT / "requirements.txt").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
|
|
self.assertIn("--enable-processing", compose)
|
|
self.assertNotIn("\n mcp:", compose)
|
|
self.assertNotIn("DEERFLOW", compose)
|
|
self.assertNotIn("ARR_MCP", compose)
|
|
self.assertNotIn("ARR_AGENT", compose)
|
|
self.assertNotIn("MCP_PUBLIC_HOST", caddy)
|
|
self.assertIn("ARR_WEB_USERNAME", compose)
|
|
self.assertIn("ARR_WEB_PASSWORD", compose)
|
|
self.assertIn("/healthz", compose)
|
|
self.assertNotIn("WEB_BASIC_AUTH", compose)
|
|
self.assertNotIn("basic_auth", caddy)
|
|
self.assertNotIn("requirements-agent-integration", root_requirements)
|
|
self.assertNotIn("requirements-arr-mcp", root_requirements)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main(verbosity=2)
|