release: freeze 2026-10-15 validated release baseline
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s

This commit is contained in:
WorkBuddy
2026-10-15 09:47:31 +08:00
parent 827c23db1d
commit 3c2b967274
149 changed files with 4324 additions and 348 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ def _ensure_activity(which: str = "A") -> str:
proc = subprocess.run(
["docker", "exec", "-i", PG_CONTAINER, "psql", "-U", "postgres", "-d", PG_DB,
"-v", "ON_ERROR_STOP=1", "-q"],
input=seed, capture_output=True, text=True,
input=seed, capture_output=True, text=True, encoding="utf-8",
)
assert proc.returncode == 0, (
f"互选前置数据 seed 失败(需要容器 {PG_CONTAINER} 可访问):\n"
+13 -3
View File
@@ -51,6 +51,9 @@ class ApiClient:
params: Optional[Dict[str, Any]] = None,
headers: Optional[Dict[str, str]] = None,
) -> requests.Response:
# 登录接口会设置运营 HttpOnly Cookie;无 token 用例必须真正模拟未认证请求。
if token is None:
self.session.cookies.clear()
merged = {"Authorization": f"Bearer {token}"} if token else {}
if headers:
# 显式传入的头覆盖默认头(幂等键等按用例定制)
@@ -117,10 +120,17 @@ def operator_password() -> str:
ADMIN_USERNAME = "e2e_admin"
# 本机活栈可通过环境变量切换到已授权的演示运营账号;CI 默认仍使用 seed 账号。
LOGIN_USERNAME = os.environ.get("E2E_OPERATOR_USERNAME", ADMIN_USERNAME)
@pytest.fixture(scope="session")
def admin_token(api: ApiClient, operator_password: str) -> str:
def admin_password(operator_password: str) -> str:
return os.environ.get("E2E_ADMIN_PASSWORD", operator_password)
@pytest.fixture(scope="session")
def admin_token(api: ApiClient, operator_password: str, admin_password: str) -> str:
"""超级管理员 token。
必须使用 **seed 脚本创建的账号**,而不是 `admin`。
@@ -135,10 +145,10 @@ def admin_token(api: ApiClient, operator_password: str) -> str:
data = api.ok(
"POST",
"/auth/operator/login",
json={"username": ADMIN_USERNAME, "password": operator_password},
json={"username": LOGIN_USERNAME, "password": admin_password},
)
token = data.get("accessToken")
assert token, f"{ADMIN_USERNAME} 登录未返回 accessToken"
assert token, f"{LOGIN_USERNAME} 登录未返回 accessToken"
return token
+1 -1
View File
@@ -84,7 +84,7 @@ def _ensure_station_seed() -> None:
proc = subprocess.run(
["docker", "exec", "-i", PG_CONTAINER, "psql", "-U", "postgres", "-d", PG_DB,
"-v", "ON_ERROR_STOP=1", "-q"],
input=seed, capture_output=True, text=True,
input=seed, capture_output=True, text=True, encoding="utf-8",
)
assert proc.returncode == 0, (
f"服务站前置数据 seed 失败(需要容器 {PG_CONTAINER} 可访问):\n"