← 返回 Skills 市场
Smoke Test Generator
作者
Nissan Dookeran
· GitHub ↗
· v1.0.0
364
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install smoke-test-generator
功能描述
Generate comprehensive API smoke test suites — categorised tests for auth, CRUD, integrations, cached vs live endpoints, with summary reporting. Use when val...
使用说明 (SKILL.md)
Smoke Test Generator
A structured pattern for API smoke testing with categorised test suites and summary reporting. Adapted from a production test suite that verified 34 endpoints across auth, CRUD, cached audio, story generation, ElevenLabs, and Mistral agent APIs.
Test Categories
| Category | What It Tests | Fail = |
|---|---|---|
| Auth | Login, token validation, protected routes | Nothing else works |
| CRUD | Create, read, update, delete operations | Data layer broken |
| Cached | Pre-cached content serves correctly | Demo will fail |
| Live | Real API calls complete successfully | External dependency down |
| Integration | End-to-end workflows across services | Pipeline broken |
Pattern
import httpx
import asyncio
BASE_URL = "http://localhost:8000"
results = {"pass": 0, "fail": 0, "skip": 0}
async def test(name: str, category: str, fn):
try:
await fn()
results["pass"] += 1
print(f" ✅ [{category}] {name}")
except Exception as e:
results["fail"] += 1
print(f" ❌ [{category}] {name}: {e}")
async def run_smoke_tests():
async with httpx.AsyncClient(base_url=BASE_URL, timeout=30) as client:
# Auth
await test("Login with valid creds", "auth",
lambda: assert_status(client.post("/login", json={"email": "[email protected]", "password": "test"}), 200))
# CRUD
await test("Create item", "crud",
lambda: assert_status(client.post("/api/items", json={"name": "test"}), 201))
# Cached
await test("Cached content returns 200", "cached",
lambda: assert_status(client.get("/api/cached/1"), 200))
# Integration
await test("Full pipeline completes", "integration",
lambda: assert_status(client.post("/api/pipeline", json={...}), 200))
total = results["pass"] + results["fail"]
print(f"\
{'='*40}")
print(f"Results: {results['pass']}/{total} passed")
if results["fail"] > 0:
print(f"⚠️ {results['fail']} failures — do not demo!")
Files
scripts/smoke_test.py— Example smoke test suite with all categories
安全使用建议
This appears to be a normal smoke-test suite for a specific demo application (Sandman Tales). Before running it: 1) Only run against staging/local environments (it issues POSTs that can create or trigger work); do not point BASE at production. 2) Review and edit tests to avoid destructive operations or calls that consume paid external resources. 3) Ensure your Python environment has the httpx dependency installed (not declared by the skill). 4) Note the tests expect particular endpoints and a Turso DB check—if your API differs, adapt the script. 5) Because the source is unknown and there is no homepage, prefer to run the script in an isolated environment (CI job or container) and inspect/modify it to suit your API before giving it network access.
功能分析
Type: OpenClaw Skill
Name: smoke-test-generator
Version: 1.0.0
The skill bundle provides a Python script (`scripts/smoke_test.py`) designed to perform API smoke tests. The `SKILL.md` explicitly declares `network.outbound: true` and states the purpose is to send HTTP requests to the API under test, which is consistent with the script's functionality. The script connects to a configurable base URL (defaulting to `https://localhost:8000`) and performs various GET/POST requests to test API endpoints. It uses hardcoded demo credentials and does not attempt to read sensitive files, environment variables, or exfiltrate data. There is no evidence of prompt injection against the agent in `SKILL.md`, nor any malicious execution, persistence, or obfuscation. The network access, while broad, is plausibly and explicitly needed for the stated purpose of testing 'any HTTP API'.
能力评估
Purpose & Capability
The skill's name and description (API smoke tests) match the included instructions and script. However the SKILL.md's claim 'Works with any HTTP API' is overstated: the provided tests are tailored to a specific API shape (endpoints like /api/orchestrate, /api/stories, /api/voice/*, /api/agents) and check for a Turso DB in /api/health. That means the suite is not truly generic and is intended for a particular application (Sandman Tales demo).
Instruction Scope
Runtime instructions and the script perform many HTTP requests (GET/POST) including POSTs that may create data or trigger generation workflows. The instructions do not read local files or environment variables beyond accepting a BASE URL argument. This is appropriate for smoke tests, but you should be aware the tests have side effects (create/orchestrate calls) and assume specific routes/behaviors.
Install Mechanism
There is no install spec (instruction-only with an included example script), so nothing is downloaded or written by an installer. Minor note: the script depends on Python and the 'httpx' library but these dependencies are not declared in metadata.
Credentials
The skill requests no environment variables or credentials and the script does not access system secrets. It uses hard-coded demo credentials in the example and accepts a BASE URL argument; this is proportionate but means you must ensure the target URL is a safe/testing environment.
Persistence & Privilege
The skill does not request permanent presence, does not alter other skills or system settings, and has 'always' false. It only issues outbound HTTP to the configured BASE URL, which matches its stated purpose.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install smoke-test-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/smoke-test-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — extracted from Sandman Tales v2 hackathon
元数据
常见问题
Smoke Test Generator 是什么?
Generate comprehensive API smoke test suites — categorised tests for auth, CRUD, integrations, cached vs live endpoints, with summary reporting. Use when val... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 364 次。
如何安装 Smoke Test Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install smoke-test-generator」即可一键安装,无需额外配置。
Smoke Test Generator 是免费的吗?
是的,Smoke Test Generator 完全免费(开源免费),可自由下载、安装和使用。
Smoke Test Generator 支持哪些平台?
Smoke Test Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Smoke Test Generator?
由 Nissan Dookeran(@nissan)开发并维护,当前版本 v1.0.0。
推荐 Skills