feat: consolida backend RAG e documentação
This commit is contained in:
parent
7c18727f62
commit
d72572ee6f
28 changed files with 2193 additions and 275 deletions
25
tests/test_runtime_port_config.py
Normal file
25
tests/test_runtime_port_config.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import json
|
||||
import re
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class RuntimePortConfigTests(unittest.TestCase):
|
||||
def test_docker_expose_matches_uvicorn_port(self):
|
||||
dockerfile = (REPO_ROOT / "rag-api/Dockerfile").read_text(encoding="utf-8")
|
||||
expose = re.search(r"(?m)^EXPOSE\s+(\d+)\s*$", dockerfile)
|
||||
command = re.search(r"(?m)^CMD\s+(\[.*\])\s*$", dockerfile)
|
||||
|
||||
self.assertIsNotNone(expose, "Dockerfile precisa declarar uma porta EXPOSE")
|
||||
self.assertIsNotNone(command, "Dockerfile precisa declarar o comando do runtime")
|
||||
|
||||
command_args = json.loads(command.group(1))
|
||||
port_index = command_args.index("--port") + 1
|
||||
self.assertEqual(expose.group(1), command_args[port_index])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue