Examples

Python SDK smoke run

Overview

Minimal Python script creating a staging run, polling to completion, and printing final status. Suitable as a smoke test in Jenkins, GitLab, or internal orchestrators.

Who should read this

  • QA engineers, SREs, platform teams, and developers operating Zof Console and APIs.

Prerequisites

  • Organization API key or authenticated CLI
  • Staging environment for safe experimentation

When to use this workflow

  • Onboarding new team members to Zof terminology and workflows
  • Authoring internal runbooks aligned with Console labels
  • Designing CI/CD or webhook integrations against documented behavior

Step-by-step procedure

Prepare environment

Store ZOF_API_KEY in CI secrets or local env.

Confirm target project and suite IDs in Console.

Apply pattern

Copy example configuration into your pipeline or service.

Adjust environment names and notification channels.

Validate

Run once manually before enforcing gates.

Capture run ID in runbook for support reference.

Key concepts

Organization scope
All Zof Console and API operations are isolated to your authenticated tenant.
Governed execution
Agent output and remediation follow policy packs with human approval when configured.

Best practices

  • Validate changes in staging before applying release gates to production.
  • Include run IDs and timestamps when escalating issues to support or auditors.
  • Align internal runbook terminology with Zof Console UI labels for clarity.

Example implementation

from zof import ZofClient
import os
client = ZofClient(api_key=os.environ["ZOF_API_KEY"])
run = client.runs.create(project_id="proj_abc", environment="staging", test_case_ids=["tc_smoke_01"])
client.runs.wait_until_complete(run.id, timeout_seconds=600)
print(run.status)

Was this page helpful?

Python SDK smoke run | Zof AI Documentation