mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
CI: modify testcase to p3 (#17047)
### Summary CI: modify longtime testcase to p3
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ from utils.file_utils import create_image_file
|
||||
|
||||
@pytest.mark.usefixtures("clear_chat_assistants")
|
||||
class TestChatAssistantCreate:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.usefixtures("add_chunks")
|
||||
@pytest.mark.parametrize(
|
||||
"name, expected_message",
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ class TestChatAssistantsDelete:
|
||||
pytest.param({"ids": ["invalid_id"]}, "Chat(invalid_id) not found.", 5, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": ["\n!?。;!?\"'"]}, """Chat(\n!?。;!?"\') not found.""", 5, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r[:1]}, "", 4, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r}, "", 0, marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"ids": r}, "", 0, marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
def test_basic_scenarios(self, client, add_chat_assistants_func, payload, expected_message, remaining):
|
||||
@@ -49,7 +49,7 @@ class TestChatAssistantsDelete:
|
||||
assistants = client.list_chats()
|
||||
assert len(assistants) == remaining
|
||||
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
def test_delete_chats_nonzero_response_raises(self, client, monkeypatch):
|
||||
class _DummyResponse:
|
||||
def json(self):
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import pytest
|
||||
|
||||
@pytest.mark.usefixtures("add_chat_assistants")
|
||||
class TestChatAssistantsList:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_default(self, client):
|
||||
assistants = client.list_chats()
|
||||
assert len(assistants) == 5
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ from utils.file_utils import create_image_file
|
||||
|
||||
|
||||
class TestChatAssistantUpdate:
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
def test_update_rejects_non_dict(self, add_chat_assistants_func):
|
||||
_, _, chat_assistants = add_chat_assistants_func
|
||||
chat_assistant = chat_assistants[0]
|
||||
@@ -31,7 +31,7 @@ class TestChatAssistantUpdate:
|
||||
chat_assistant.update.__wrapped__(chat_assistant, "bad")
|
||||
assert "`update_message` must be a dict" in str(exception_info.value)
|
||||
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
def test_update_raises_on_nonzero_response(self, add_chat_assistants_func, monkeypatch):
|
||||
_, _, chat_assistants = add_chat_assistants_func
|
||||
chat_assistant = chat_assistants[0]
|
||||
@@ -46,7 +46,7 @@ class TestChatAssistantUpdate:
|
||||
chat_assistant.update({"name": "error-case"})
|
||||
assert "boom" in str(exception_info.value)
|
||||
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_update_uses_patch_for_partial_payload(self, add_chat_assistants_func, monkeypatch):
|
||||
_, _, chat_assistants = add_chat_assistants_func
|
||||
chat_assistant = chat_assistants[0]
|
||||
|
||||
@@ -89,7 +89,7 @@ class TestAddChunk:
|
||||
chunks = document.list_chunks()
|
||||
assert len(chunks) == chunks_count + 1, str(chunks)
|
||||
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.parametrize(
|
||||
"payload, expected_message",
|
||||
[
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ class TestChunksDeletion:
|
||||
"payload",
|
||||
[
|
||||
pytest.param(lambda r: {"ids": ["invalid_id"] + r}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r[:1] + ["invalid_id"] + r[1:4]}, marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"ids": r[:1] + ["invalid_id"] + r[1:4]}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r + ["invalid_id"]}, marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
@@ -92,7 +92,7 @@ class TestChunksDeletion:
|
||||
pytest.param({"ids": ["invalid_id"]}, "rm_chunk deleted chunks 0, expect 1", 5, marks=pytest.mark.p3),
|
||||
pytest.param("not json", "UnboundLocalError", 5, marks=pytest.mark.skip(reason="pull/6376")),
|
||||
pytest.param(lambda r: {"ids": r[:1]}, "", 4, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r}, "", 1, marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"ids": r}, "", 1, marks=pytest.mark.p3),
|
||||
pytest.param({"ids": []}, "", 5, marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ from utils.engine_utils import get_doc_engine
|
||||
|
||||
|
||||
class TestChunksList:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.parametrize(
|
||||
"params, expected_page_size, expected_message",
|
||||
[
|
||||
@@ -136,7 +136,7 @@ class TestChunksList:
|
||||
assert len(responses) == count, responses
|
||||
assert all(len(future.result()) == 5 for future in futures)
|
||||
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_default(self, add_document):
|
||||
_, document = add_document
|
||||
batch_add_chunks(document, 31)
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ DOC_ENGINE = (os.getenv("DOC_ENGINE") or "").lower()
|
||||
|
||||
|
||||
class TestChunksRetrieval:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.parametrize(
|
||||
"payload, expected_page_size, expected_message",
|
||||
[
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import pytest
|
||||
|
||||
|
||||
class TestUpdatedChunk:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.parametrize(
|
||||
"payload, expected_message",
|
||||
[
|
||||
|
||||
+4
-4
@@ -58,12 +58,12 @@ class TestDocumentsParse:
|
||||
"payload, expected_message",
|
||||
[
|
||||
pytest.param(None, "AttributeError", marks=pytest.mark.skip),
|
||||
pytest.param({"document_ids": []}, "`document_ids` is required", marks=pytest.mark.p1),
|
||||
pytest.param({"document_ids": []}, "`document_ids` is required", marks=pytest.mark.p3),
|
||||
pytest.param({"document_ids": ["invalid_id"]}, "Documents not found: ['invalid_id']", marks=pytest.mark.p3),
|
||||
pytest.param({"document_ids": ["\n!?。;!?\"'"]}, "Documents not found: ['\\n!?。;!?\"\\'']", marks=pytest.mark.p3),
|
||||
pytest.param("not json", "AttributeError", marks=pytest.mark.skip),
|
||||
pytest.param(lambda r: {"document_ids": r[:1]}, "", marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"document_ids": r}, "", marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"document_ids": r[:1]}, "", marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"document_ids": r}, "", marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
def test_basic_scenarios(self, add_documents_func, payload, expected_message):
|
||||
@@ -84,7 +84,7 @@ class TestDocumentsParse:
|
||||
"payload",
|
||||
[
|
||||
pytest.param(lambda r: {"document_ids": ["invalid_id"] + r}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"document_ids": r[:1] + ["invalid_id"] + r[1:3]}, marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"document_ids": r[:1] + ["invalid_id"] + r[1:3]}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"document_ids": r + ["invalid_id"]}, marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestAuthorization:
|
||||
|
||||
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
|
||||
class TestForgetMessage:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_forget_message(self, client):
|
||||
memory_id = self.memory_id
|
||||
memory = Memory(client, {"id": memory_id})
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestAuthorization:
|
||||
|
||||
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
|
||||
class TestGetRecentMessage:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_get_recent_messages(self, client):
|
||||
memory_id = self.memory_id
|
||||
res = client.get_recent_messages([memory_id])
|
||||
|
||||
@@ -41,7 +41,7 @@ class TestAuthorization:
|
||||
|
||||
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
|
||||
class TestMessageList:
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
def test_params_unset(self, client):
|
||||
memory_id = self.memory_id
|
||||
memory = Memory(client, {"id": memory_id})
|
||||
|
||||
@@ -39,7 +39,7 @@ class TestAuthorization:
|
||||
|
||||
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
|
||||
class TestUpdateMessageStatus:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
def test_update_to_false(self, client):
|
||||
memory_id = self.memory_id
|
||||
memory = Memory(client, {"id": memory_id})
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class _DummyStreamResponse:
|
||||
|
||||
@pytest.mark.usefixtures("clear_session_with_chat_assistants")
|
||||
class TestSessionWithChatAssistantCreate:
|
||||
@pytest.mark.p1
|
||||
@pytest.mark.p3
|
||||
@pytest.mark.parametrize(
|
||||
"name, expected_message",
|
||||
[
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class TestSessionWithChatAssistantDelete:
|
||||
"payload",
|
||||
[
|
||||
pytest.param(lambda r: {"ids": ["invalid_id"] + r}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r[:1] + ["invalid_id"] + r[1:5]}, marks=pytest.mark.p1),
|
||||
pytest.param(lambda r: {"ids": r[:1] + ["invalid_id"] + r[1:5]}, marks=pytest.mark.p3),
|
||||
pytest.param(lambda r: {"ids": r + ["invalid_id"]}, marks=pytest.mark.p3),
|
||||
],
|
||||
)
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ def set_tenant_info():
|
||||
|
||||
|
||||
class TestSessionsWithChatAssistantList:
|
||||
@pytest.mark.p2
|
||||
@pytest.mark.p3
|
||||
def test_list_sessions_raises_on_nonzero_response(self, add_sessions_with_chat_assistant, monkeypatch):
|
||||
chat_assistant, _ = add_sessions_with_chat_assistant
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ class TestSessionWithChatAssistantUpdate:
|
||||
@pytest.mark.parametrize(
|
||||
"payload, expected_message",
|
||||
[
|
||||
pytest.param({"name": "valid_name"}, "", marks=pytest.mark.p1),
|
||||
pytest.param({"name": "valid_name"}, "", marks=pytest.mark.p3),
|
||||
pytest.param({"name": "a" * (SESSION_WITH_CHAT_NAME_LIMIT + 1)}, "", marks=pytest.mark.skip(reason="issues/")),
|
||||
pytest.param({"name": 1}, "", marks=pytest.mark.skip(reason="issues/")),
|
||||
pytest.param({"name": ""}, "`name` can not be empty.", marks=pytest.mark.p3),
|
||||
|
||||
Reference in New Issue
Block a user