mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-11-12 22:20:33 +00:00
* fix(nginx): use checkout-local temp paths for local development * docs(nginx): clarify local request buffering comment * docs: keep nginx guidance within the inherited byte budget --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
19 lines
830 B
Python
19 lines
830 B
Python
"""Local nginx must use the writable directories prepared by its launchers."""
|
|
|
|
import re
|
|
|
|
import pytest
|
|
from support.nginx_conf import REPO_ROOT, read_config
|
|
|
|
|
|
@pytest.mark.parametrize("kind", ["client_body", "proxy", "fastcgi", "uwsgi", "scgi"])
|
|
def test_local_nginx_temp_path_matches_launchers(kind: str) -> None:
|
|
directory = f"temp/{kind}_temp"
|
|
config = read_config("docker/nginx/nginx.local.conf")
|
|
paths = re.findall(rf"^[ \t]*{kind}_temp_path[ \t]+([^;\n]+);", config, re.M)
|
|
assert paths == [directory]
|
|
|
|
for launcher in ("scripts/serve.sh", "scripts/nginx.sh"):
|
|
lines = (REPO_ROOT / launcher).read_text(encoding="utf-8").splitlines()
|
|
assert any(line.startswith("mkdir -p ") and directory in line.split()[2:] for line in lines), f"{launcher} must create {directory} before starting nginx"
|