用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Azure/azure-sdk-for-rust --skill create-recorded-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | create-recorded-test |
| description | Generate a new recorded integration test |
| disable-model-invocation | true |
You will generate one or more recorded integration tests under the sdk/{service-directory}/{crate-name}/tests directory in ${input:testFile:test_file}.rs where:
{repo-root} is the root directory containing Cargo.toml.{service-directory} is the directory name under sdk for the current ${file} e.g., keyvault.{crate-name} is the crate directory name under sdk/{service-directory} for the current ${file} e.g., azure_security_keyvault_secrets.These instructions only need to be done once. If changes described are already present, do not make the changes again.
Recorded tests must always be integration tests under the sdk/{service-directory}/{crate-name}/tests directory. Do not add recorded tests to src/, examples/, or README.md.
If PowerShell is not installed, stop and ask the user to install it first using PowerShell installation instructions.
Provision test resources using the full script path:
{repo-root}/eng/common/TestResources/New-TestResources.ps1 -ServiceDirectory {service-directory}
To run recorded tests, rely on the existing test infrastructure. Test Proxy is acquired automatically for test runs when needed, but not for test-proxy push -a sdk/{service-directory}/assets.json.
For manual Test Proxy usage or asset publishing, see CONTRIBUTING.md and the Test Proxy documentation.
For each new recorded test:
sdk/{service-directory}/{crate-name}/tests/${input:testFile}.rs, add or update async integration tests attributed with #[recorded::test].async fn ${input:testName}(ctx: TestContext) -> Result<()>.let recording = ctx.recording();let mut options = {Client}Options::default();recording.instrument(&mut options.client_options);recording.var("{ENV_VAR}", None).as_str(), recording.credential(), and Some(options).TestContext, and required ClientOptions instrumentation.#[recorded::test] functions.Record or update sessions against live resources:
AZURE_TEST_MODE=record cargo test -p {crate-name} --test ${input:testFile}
Run playback to make sure tests were properly recorded:
cargo test -p {crate-name} --test ${input:testFile}
After recording and playback succeeds, publish updated recordings only if test-proxy is already installed and available:
test-proxy push -a sdk/{service-directory}/assets.json
Remove provisioned test resources using the full script path when they are no longer needed:
{repo-root}/eng/common/TestResources/Remove-TestResources.ps1 -ServiceDirectory {service-directory}
Run pre-commit checks for a specific set of crates. Use this when validating changes under sdk/cosmos before committing or during code review.
Check and fix spelling in project source files using cSpell.
Generate a new performance test
基于 SOC 职业分类