From 06f0083a764084661354d6631606b36deed3d0e2 Mon Sep 17 00:00:00 2001 From: greatmengqi Date: Fri, 17 Apr 2026 11:51:51 +0800 Subject: [PATCH] fix(tests): e2e_env overrides conftest's AppConfig.from_file stub The autouse fixture in conftest.py stubs AppConfig.from_file to return a minimal config (no models) so unit tests don't need a real config.yaml. TestConfigManagement in test_client_e2e asserts that the client loads a real e2e config with a known model, which broke in CI after the conftest change. Make e2e_env monkey-patch AppConfig.from_file to return _make_e2e_config() so DeerFlowClient loads the e2e-specific config when the fixture runs. --- backend/tests/test_client_e2e.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/tests/test_client_e2e.py b/backend/tests/test_client_e2e.py index 42144fb1e..3b66c571d 100644 --- a/backend/tests/test_client_e2e.py +++ b/backend/tests/test_client_e2e.py @@ -102,6 +102,11 @@ def e2e_env(tmp_path, monkeypatch): monkeypatch.setattr("deerflow.config.paths._paths", None) monkeypatch.setattr("deerflow.sandbox.sandbox_provider._default_sandbox_provider", None) + # 1b. Override the autouse ``AppConfig.from_file`` stub from conftest + # (minimal test config) with the e2e-specific config that carries a + # real model entry and disables title/memory/summarization. + monkeypatch.setattr(AppConfig, "from_file", staticmethod(lambda config_path=None: _make_e2e_config())) + # 2. Exclude TitleMiddleware from the chain. # It triggers an extra LLM call to generate a thread title, which adds # non-determinism and cost to E2E tests (title generation is already