# Multi-Level Automated Testing System Documentation ## Document Overview This testing system aims to build a complete, efficient, and well-structured quality assurance framework for the development, integration, and release of model services. It draws on the concept of the test pyramid from modern software engineering, progressively expanding testing activities from basic code logic verification to complex end-to-end (E2E) functionality, performance, accuracy, and even long-term stability validation. Through five levels (L1-L5) and common (Common) specifications, the system clarifies the testing objectives, scope, execution frequency, and required resources for different development stages (e.g., each commit, PR merge, daily build, pre-release). This ensures that models meet high standards for functionality, performance, and reliability across various deployment scenarios (online serving and offline inference).
| Level | Scope & Focus | Time Cost | Test Dir | Doc | Frequency | Hardware |
|---|---|---|---|---|---|---|
| Common | Contribution Guideline & PR checklist | / | / | .github/PULL_REQUEST_TEMPLATE.md Test Style (PR Checklist) | / | / |
| CI Failure Description | / | / | CI Failures | / | / | |
| L1 (Unit & Logic) |
Unit tests for components like entrypoints, models | <15min | /tests/{component_name}/test_xxx |
Chapter 1 Section 1 L1&L2: Purpose, Test Content, Directory Location, Example |
PR with ready label (also can run locally) | CPU |
| L2 (E2E across models & GPU-required UT) |
Online & Offline (basic deployment scenarios): dummy, normal inference function (output format, stream), some instance startup UT |
/tests/e2e/online_serving/test_{model_name}.py /tests/e2e/offline_inference/test_{model_name}.py |
Chapter 1 L1&L2: Purpose, Test Content, Directory Location, Example |
PR with ready label | GPU | |
| L3 (Important Perf & Integration & Accuracy) |
Online & Offline (multiple deployment scenarios): real model, normal inference function, normal accuracy |
<30min |
/tests/e2e/online_serving/test_{model_name}.py /tests/e2e/offline_inference/test_{model_name}.py |
Chapter 2 L3: Purpose, Test Content, Directory Location, Example |
PR Merged (Also run L1&L2 Tests) | GPU |
| L4 (Perf & Integration & Accuracy) |
Online & Offline: full functional scenarios + performance test + doc test | <3 hour |
Full Function: /tests/e2e/online_serving/test_{model_name}_expansion.py /tests/e2e/offline_inference/test_{model_name}_expansion.py Performance: /tests/e2e/perf/nightly.json Doc Test: tests/example/online_serving/test_{model_name}.py tests/example/offline_inference/test_{model_name}.py |
Chapter 3 L4: Purpose, Test Content, Directory Location, Example |
Nightly | GPU |
| L5 (Stability & Reliability) |
Online & Offline: long-term stability test + reliability test | Depends on reality |
Stability: tests/e2e/stability/weekly.json Reliability: tests/e2e/reliability/test_{model_name}.py |
Chapter 4 L5: Purpose, Test Content, Directory Location, Example |
Weekly / Days before Release | GPU |