Skip to main content
Running a benchmark is normally a low-frequency, manual operation. Clousight Bench makes it a pytest test and a CI exit-code gate so a benchmark can live inside an enterprise CI pipeline as a red/green check.

pytest — assert_run

The pytest plugin auto-loads (via the pytest11 entry point) once clousight-bench is installed — no conftest wiring. Call assert_run in any test; it runs one suite and raises AssertionError unless the run completes and every threshold is met:
Or via the injected clousight fixture:
target defaults to {"mode": "mock"} (the offline path), so a gate runs in CI with no cloud account; point it at a real endpoint/service to gate production.

CI without pytest — csbench run --assert

Threshold model

Measurements are heterogeneous (accuracy is higher-is-better; latency/cost are lower-is-better), so a threshold declares a direction: A gated key that the run did not measure is a failure. The same model backs both assert_run (pytest) and csbench run --assert (CI exit code).