Fix(test): downgrade test priorities (#12913)

### What problem does this PR solve?

Changed test priorities in multiple test files, downgrading from p1 to
p2 and p2 to p3.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Liu An
2026-01-30 20:02:56 +08:00
committed by GitHub
parent eb75b1ce82
commit c4f60b349d
60 changed files with 108 additions and 104 deletions

View File

@ -36,7 +36,7 @@ def validate_chunk_details(auth, kb_id, doc_id, payload, res):
assert chunk["question_kwd"] == expected
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -22,7 +22,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -22,7 +22,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -24,7 +24,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -26,7 +26,7 @@ from common import create_dialog
@pytest.mark.usefixtures("clear_dialogs")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -23,7 +23,7 @@ from libs.auth import RAGFlowWebApiAuth
@pytest.mark.usefixtures("clear_dialogs")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from libs.auth import RAGFlowWebApiAuth
@pytest.mark.usefixtures("clear_dialogs")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from libs.auth import RAGFlowWebApiAuth
@pytest.mark.usefixtures("clear_dialogs")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from libs.auth import RAGFlowWebApiAuth
@pytest.mark.usefixtures("clear_dialogs")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -48,7 +48,7 @@ class TestDialogUpdate:
assert res["code"] == 0, res
assert res["data"]["name"] == new_name, res
@pytest.mark.p1
@pytest.mark.p2
def test_update_description(self, WebApiAuth, add_dialog_func):
_, dialog_id = add_dialog_func
new_description = "Updated description"

View File

@ -22,7 +22,7 @@ from libs.auth import RAGFlowWebApiAuth
from utils import is_sorted
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -63,7 +63,7 @@ def validate_document_parse_cancel(auth, _kb_id, _document_ids):
assert doc["progress"] == 0.0
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
@pytest.mark.p1
@pytest.mark.p2
class TestAuthorization:
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",

View File

@ -74,7 +74,7 @@ class TestDocumentsUpload:
assert res["data"][0]["kb_id"] == kb_id, res
assert res["data"][0]["name"] == fp.name, res
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"file_type",
["exe", "unknown"],
@ -113,7 +113,7 @@ class TestDocumentsUpload:
assert res["code"] == 101, res
assert res["message"] == "No file selected!", res
@pytest.mark.p2
@pytest.mark.p3
def test_filename_exceeds_max_length(self, WebApiAuth, add_dataset_func, tmp_path):
kb_id = add_dataset_func
fp = create_txt_file(tmp_path / f"{'a' * (DOCUMENT_NAME_LIMIT - 4)}.txt")

View File

@ -25,7 +25,7 @@ from utils.hypothesis_utils import valid_names
@pytest.mark.usefixtures("clear_datasets")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -22,7 +22,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -23,7 +23,7 @@ from utils import is_sorted
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -50,7 +50,7 @@ class TestCapability:
@pytest.mark.usefixtures("add_datasets")
class TestDatasetsList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, WebApiAuth):
res = list_kbs(WebApiAuth, None)
assert res["code"] == 0, res
@ -139,7 +139,7 @@ class TestDatasetsList:
assert res["code"] == 0, res
assert len(res["data"]["kbs"]) == 5, res
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"params, assertions",
[
@ -153,7 +153,7 @@ class TestDatasetsList:
if callable(assertions):
assert assertions(res), res
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"params, assertions",
[

View File

@ -24,7 +24,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -27,7 +27,7 @@ from utils.hypothesis_utils import valid_names
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -162,7 +162,7 @@ class TestDatasetUpdate:
assert res["code"] == 0, res
assert res["data"]["embd_id"] == embedding_model, res
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"permission",
[

View File

@ -26,14 +26,14 @@ INVALID_AUTH_CASES = [
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize("invalid_auth, expected_code, expected_message", INVALID_AUTH_CASES)
def test_auth_invalid_factories(self, invalid_auth, expected_code, expected_message):
res = llm_factories(invalid_auth)
assert res["code"] == expected_code, res
assert res["message"] == expected_message, res
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize("invalid_auth, expected_code, expected_message", INVALID_AUTH_CASES)
def test_auth_invalid_list(self, invalid_auth, expected_code, expected_message):
res = llm_list(invalid_auth)

View File

@ -25,7 +25,7 @@ from utils.hypothesis_utils import valid_names
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -47,12 +47,12 @@ class TestCapability:
@pytest.mark.usefixtures("add_memory_func")
class TestMemoryList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, WebApiAuth):
res = list_memory(WebApiAuth, None)
assert res["code"] == 0, res
@pytest.mark.p1
@pytest.mark.p2
def test_params_empty(self, WebApiAuth):
res = list_memory(WebApiAuth, {})
assert res["code"] == 0, res

View File

@ -19,7 +19,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -24,7 +24,7 @@ from utils.hypothesis_utils import valid_names
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -80,7 +80,7 @@ class TestMemoryUpdate:
assert res["code"] == 0, res
assert res["data"]["name"] == "Test_Memory(1)", res
@pytest.mark.p1
@pytest.mark.p2
def test_avatar(self, WebApiAuth, add_memory_func, tmp_path):
memory_ids = add_memory_func
fn = create_image_file(tmp_path / "ragflow_test.png")
@ -89,7 +89,7 @@ class TestMemoryUpdate:
assert res["code"] == 0, res
assert res["data"]["avatar"] == f"data:image/png;base64,{encode_avatar(fn)}", res
@pytest.mark.p1
@pytest.mark.p2
def test_description(self, WebApiAuth, add_memory_func):
memory_ids = add_memory_func
description = "This is a test description."
@ -107,7 +107,7 @@ class TestMemoryUpdate:
assert res["code"] == 0, res
assert res["data"]["llm_id"] == llm_id, res
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"permission",
[

View File

@ -22,7 +22,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -22,7 +22,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -23,7 +23,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[
@ -40,14 +40,14 @@ class TestAuthorization:
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
class TestMessageList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, WebApiAuth):
memory_id = self.memory_id
res = list_memory_message(WebApiAuth, memory_id, params=None)
assert res["code"] == 0, res
assert len(res["data"]["messages"]["message_list"]) == 5, res
@pytest.mark.p1
@pytest.mark.p2
def test_params_empty(self, WebApiAuth):
memory_id = self.memory_id
res = list_memory_message(WebApiAuth, memory_id, params={})

View File

@ -19,7 +19,7 @@ from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -22,7 +22,7 @@ from libs.auth import RAGFlowWebApiAuth
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_code, expected_message",
[

View File

@ -26,7 +26,7 @@ INVALID_AUTH_CASES = [
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize("invalid_auth, expected_code, expected_message", INVALID_AUTH_CASES)
def test_auth_invalid(self, invalid_auth, expected_code, expected_message):
res = plugin_llm_tools(invalid_auth)