Test: Configure test case priorities to reduce CI execution time (#7532)

### What problem does this PR solve?

Configure test case priorities to reduce CI execution time

### Type of change

- [x] Test cases update
This commit is contained in:
liu an
2025-05-08 19:22:52 +08:00
committed by GitHub
parent 1657755b5d
commit 0fbca63e9d
27 changed files with 300 additions and 143 deletions

View File

@ -40,6 +40,29 @@ from libs.utils.file_utils import (
create_txt_file,
)
MARKER_EXPRESSIONS = {
"p1": "p1",
"p2": "p1 or p2",
"p3": "p1 or p2 or p3",
}
def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption(
"--level",
action="store",
default="p2",
choices=list(MARKER_EXPRESSIONS.keys()),
help=f"Test level ({'/'.join(MARKER_EXPRESSIONS)}): p1=smoke, p2=core, p3=full",
)
def pytest_configure(config: pytest.Config) -> None:
level = config.getoption("--level")
config.option.markexpr = MARKER_EXPRESSIONS[level]
if config.option.verbose > 0:
print(f"\n[CONFIG] Active test level: {level}")
@wait_for(30, 1, "Document parsing timeout")
def condition(_auth, _dataset_id):