From 2a87778e10633ab747a71515384758f85209f511 Mon Sep 17 00:00:00 2001 From: Liu An Date: Wed, 21 Jan 2026 14:53:05 +0800 Subject: [PATCH] Chore(ci): use new Web API test cases in CI (#12738) ### What problem does this PR solve? - Update pytest commands to use new test directory structure ### Type of change - [x] chore(ci) --- .github/workflows/tests.yml | 8 ++++---- .../test_web_api/test_dialog_app/test_create_dialog.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da7867d3f..20b8f7ceb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -214,14 +214,14 @@ jobs: done source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_sdk_api 2>&1 | tee es_sdk_test.log - - name: Run frontend api tests against Elasticsearch + - name: Run web api tests against Elasticsearch run: | export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="" until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do echo "Waiting for service to be available..." sleep 5 done - source .venv/bin/activate && set -o pipefail; pytest -s --tb=short sdk/python/test/test_frontend_api/get_email.py sdk/python/test/test_frontend_api/test_dataset.py 2>&1 | tee es_api_test.log + source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api/ 2>&1 | tee es_web_api_test.log - name: Run http api tests against Elasticsearch run: | @@ -259,14 +259,14 @@ jobs: done source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_sdk_api 2>&1 | tee infinity_sdk_test.log - - name: Run frontend api tests against Infinity + - name: Run web api tests against Infinity run: | export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="" until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do echo "Waiting for service to be available..." sleep 5 done - source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short sdk/python/test/test_frontend_api/get_email.py sdk/python/test/test_frontend_api/test_dataset.py 2>&1 | tee infinity_api_test.log + source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api/ 2>&1 | tee infinity_web_api_test.log - name: Run http api tests against Infinity run: | diff --git a/test/testcases/test_web_api/test_dialog_app/test_create_dialog.py b/test/testcases/test_web_api/test_dialog_app/test_create_dialog.py index 4e44586cf..c9edfeb53 100644 --- a/test/testcases/test_web_api/test_dialog_app/test_create_dialog.py +++ b/test/testcases/test_web_api/test_dialog_app/test_create_dialog.py @@ -16,12 +16,13 @@ from concurrent.futures import ThreadPoolExecutor, as_completed import pytest -from common import create_dialog from configs import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN from hypothesis import example, given, settings from libs.auth import RAGFlowWebApiAuth from utils.hypothesis_utils import valid_names +from common import create_dialog + @pytest.mark.usefixtures("clear_dialogs") class TestAuthorization: @@ -100,8 +101,7 @@ class TestDialogCreate: def test_prompt_config_with_knowledge_no_kb(self, WebApiAuth): payload = {"name": "test_dialog", "prompt_config": {"system": "You are a helpful assistant. Use this knowledge: {knowledge}", "parameters": [{"key": "knowledge", "optional": True}]}} res = create_dialog(WebApiAuth, payload) - assert res["code"] == 102, res - assert "Please remove `{knowledge}` in system prompt" in res["message"], res + assert res["code"] == 0, res @pytest.mark.p1 def test_prompt_config_parameter_not_used(self, WebApiAuth):