一键导入
integration-testing
Guidance for writing and running Python/pytest integration tests against APIM, App Gateway, and AI services in ai-hub-tracking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidance for writing and running Python/pytest integration tests against APIM, App Gateway, and AI services in ai-hub-tracking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guidance for producing Terraform, Bash, and GitHub Actions changes in ai-hub-tracking. Use when implementing Terraform modules, stacks, deployment scripts, or GitHub Actions workflows.
Guidance for Azure AI Evaluation SDK usage in the Python integration harness for ai-hub-tracking.
Guidance for APIM policies, routing, and backend configuration in ai-hub-tracking. Use when modifying APIM inbound/outbound policies, rate limiting, backend routing, or API key authentication.
Guidance for Application Gateway rewrite rules, WAF custom rules, and request security layers in ai-hub-tracking. Use when modifying App Gateway rewrite rules, WAF custom rules, subscription key normalization, or SSL configuration.
Guidance for upgrading tracked Python and npm dependencies in ai-hub-tracking. Use when updating pyproject.toml or package.json, regenerating uv.lock or package-lock.json through package managers, responding to Dependabot or Renovate dependency alerts, or adjusting dependency automation in renovate.json.
Guidance for maintaining documentation in the docs/ site for ai-hub-tracking. Use when updating HTML pages, partials, build scripts, or Terraform reference docs.
| name | integration-testing |
| description | Guidance for writing and running Python/pytest integration tests against APIM, App Gateway, and AI services in ai-hub-tracking. |
Use this skill profile when creating, modifying, or debugging integration tests in this repo.
tests/integration/tests/tests/integration/src/ai_hub_integration/run-tests.py, run-tests.sh, or suite alias/group behaviorRequired context before making test changes:
document_intelligence_enabled, key rotation, tenant capabilities)Every test change should deliver:
tests/integration/README.md Folder Structure section in the same change. Do not add gitignored or local-only artifacts to that tree.tests/integration/src/ai_hub_integration/config.py, client.py, runner.pytests/test_*.pytests/unit/run-tests.py, run-tests.shrun-evaluation.py| File | Focus |
|---|---|
tests/test_chat_completions.py | OpenAI deployment-route coverage centered on ai-hub-admin with NR-DAP smoke checks |
tests/test_v1_chat_completions.py | OpenAI /openai/v1 format, streaming SSE, Bearer auth, and rate-limit regression checks |
tests/test_document_intelligence.py | JSON and async Document Intelligence coverage centered on ai-hub-admin |
tests/test_document_intelligence_binary.py | WAF/App Gateway allow-rules for binary and multipart Document Intelligence uploads |
tests/test_app_gateway.py | App Gateway TLS, routing, auth normalization, and the retained cross-key verification |
tests/test_apim_key_rotation.py | /internal/apim-keys endpoint, rotation metadata, and Key Vault fallback coverage |
tests/test_tenant_info.py | Tenant info endpoint, model metadata, and service feature flags for ai-hub-admin |
tests/test_mistral.py | Mistral chat and OCR routing via APIM |
tests/test_ai_evaluation.py | Optional Azure AI Evaluation SDK scoring |
run-tests.py is the authoritative runner. It provides:
chat-completions, apim-key-rotation, etc.)all, direct, proxyai_eval suitesThe shell wrapper run-tests.sh exists for convenience and backwards-compatible local usage, but it delegates to run-tests.py.
cd tests/integration
uv sync --group dev
# Unit tests for shared logic
uv run pytest tests/unit -q
# All live suites
uv run python ./run-tests.py --env test --group all
# Direct-only suites
uv run python ./run-tests.py --env test --group direct
# Proxy-only suites
HTTP_PROXY=http://127.0.0.1:8118 \
HTTPS_PROXY=http://127.0.0.1:8118 \
uv run python ./run-tests.py --env test --group proxy
| Pattern | When to use |
|---|---|
require_key(config, tenant) | Test requires a tenant subscription key |
require_appgw(config) | Test requires App Gateway to be deployed |
integration_config.is_apim_key_rotation_enabled() | Key-rotation endpoint can be disabled per environment |
pytest.skip(...) | Inline skip for unavailable infrastructure or optional evaluation config |
.github/workflows/.integration-tests-using-secure-tunnel.yml splits execution into:
uv run python ./run-tests.py --group directuv run python ./run-evaluation.py when judge-model secrets and vars existuv run python ./run-tests.py --group proxy with HTTP_PROXY/HTTPS_PROXY set to the Bastion SOCKS tunnel (fronted by privoxy)uv sync --group dev succeedsuv run ruff check . is cleanuv run ruff format --check . is cleanuv run pytest tests/unit -q passeswait_for_operationFor helper signatures, config loading rules, retry behavior, secure-tunnel expectations, and failure playbooks, see references/REFERENCE.md.