Mosaic CLI Docs 中文

Regression

Regression Tutorial: From Zero to Release Gate

Use this page to run a full verification sequence. It includes unit tests, smoke tests, and CLI behavior checks.

1. Fast quality gate

make cli-quality

This runs formatting/linting/static checks configured by the project.

2. Workspace tests

cd cli
cargo test --workspace

3. Full scripted regression (recommended)

cd cli
./scripts/run_regression_suite.sh

Output reports are written under cli/reports/.

4. Beginner-friendly end-to-end script

cd cli
./scripts/tutorial_regression.sh

This script creates an isolated temp project, checks directory/channels/gateway/system flows, and saves a report.

5. Optional live provider smoke

export OPENAI_API_KEY=<your_key>
cd cli
LIVE=1 \
BASE_URL=https://api.openai.com \
MODEL=gpt-4o-mini \
./scripts/tutorial_regression.sh

When LIVE=1, the script also runs setup, models list, and one ask.

6. JSON contract checks

mosaic --project-state --json status
mosaic --project-state --json channels list
mosaic --project-state --json gateway probe
mosaic --project-state --json doctor

7. Release gate checklist

  • cargo test --workspace passes.
  • Regression scripts complete without non-zero exits.
  • Main channel test/send paths are healthy.
  • Gateway probe and call status are successful.
  • --json outputs remain parseable for CI consumers.

8. Troubleshooting failed regression

mosaic --project-state doctor
mosaic --project-state logs --tail 200
mosaic --project-state channels status
mosaic --project-state gateway status --deep