sdk-e2e-cases
GitHub用于编写、审查和运行 CubeSandbox SDK 兼容性 E2E pytest 测试用例。涵盖用例开发、代码审查、执行及调试,支持生命周期、网络策略等场景的端到端验证。
Trigger Scenarios
Install
npx skills add TencentCloud/CubeSandbox --skill sdk-e2e-cases -g -y
SKILL.md
Frontmatter
{
"name": "sdk-e2e-cases",
"description": "Write, review, and execute CubeSandbox SDK compatibility E2E pytest cases. Use when the user asks to add, design, review, debug, or run SDK E2E cases under tests\/e2e\/sdk_compat, or mentions lifecycle, network policy, sandbox templates, backend compatibility, pytest markers, or live E2E validation."
}
SDK E2E Cases
Use this skill for CubeSandbox SDK compatibility E2E work in tests/e2e/sdk_compat.
Required First Steps
- Read the relevant local docs before changing tests:
tests/e2e/sdk_compat/README.mdtests/e2e/sdk_compat/docs/case-authoring.mdtests/e2e/sdk_compat/docs/test-coverage.mdtests/e2e/sdk_compat/docs/framework-design.md
- Inspect nearby cases in the same domain directory before writing a new case.
- Decide whether the request is case authoring, review, execution, or debugging, then follow the matching workflow below.
Authoring Workflow
- Classify the behavior domain:
commands,filesystem,host-mount,lifecycle,network,run_code, orconcurrency. - Decide whether the behavior is a shared SDK contract or backend-specific behavior.
- Use capability and environment markers for unsupported prerequisites. Do not hide backend differences with loose assertions.
- Prefer existing fixtures and helpers over new abstractions:
sdk_sandboxsdk_e2e_configsdk_backendsandbox_create_optionssandbox_template_id
- Keep assertions contract-focused and diagnostics useful. Include IDs, states, URLs, status codes, and short response snippets where helpful, but do not log secrets or traffic access token values.
- Add or update docs only when the case introduces a new pattern, marker, environment variable, template requirement, or coverage category.
Review Workflow
Review SDK E2E changes for:
- Correctness: the test asserts product/SDK contracts, not incidental implementation details.
- Backend compatibility: shared cases run across selected backends, and unsupported behavior uses capability markers.
- Lifecycle semantics:
runningmeans the sandbox data plane should be usable; do not mask backend bugs with broad retries. - Resource cleanup: created sandboxes are cleaned with existing fixtures/helpers unless intentionally preserved by framework behavior.
- Security: do not print API keys, traffic access tokens, machine IPs, or sensitive headers.
- Stability: avoid fixed sleeps, public internet assumptions without markers, and unbounded polling.
- Maintainability: prefer existing helpers, readable markers, and focused tests.
Execution Workflow
From tests/e2e/sdk_compat, use the smallest command that validates the change:
pytest --collect-only -q
pytest --run-e2e -m "p0 and not slow"
pytest --run-e2e cases/lifecycle/test_create.py -q
pytest --run-e2e cases/network/test_policy.py -q
For live runs, check that required environment variables are documented and intentionally set. Use SDK_E2E_KEEP_SANDBOX_ON_FAILURE=true only when debugging failures.
Additional Reference
For concrete marker templates, review checklists, and command patterns, read REFERENCE.md.
Version History
- 5cefcca Current 2026-08-08 07:59


