-
Notifications
You must be signed in to change notification settings - Fork 320
Reduce noise in Key Vault README code samples #3337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Uses the `include_file::include_markdown!()` macro to include otherwise non-compilable Rust code snippets from the README.md files.
Cleans up the test file nicely.
29f3688 to
5e3d035
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes Key Vault README code samples compilable and testable by using the include_file::include_markdown!() macro. The changes allow README code snippets to be executed as part of the test suite, improving documentation accuracy and maintainability.
Key Changes
- Adds test files for secrets, keys, and certificates that execute README code snippets using the
include_markdown!macro - Updates README code blocks from
rust no_runtorust ignorewith named labels to enable extraction and testing - Adds
include-fileworkspace dependency and includes it in the three affected Key Vault crates
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/keyvault/azure_security_keyvault_secrets/tests/readme.rs |
New test file executing README code snippets for secrets client |
sdk/keyvault/azure_security_keyvault_secrets/README.md |
Refactored code samples to be testable with labeled rust ignore blocks |
sdk/keyvault/azure_security_keyvault_secrets/Cargo.toml |
Added include-file dev dependency |
sdk/keyvault/azure_security_keyvault_keys/tests/readme.rs |
New test file with custom rand module to override random number generation for deterministic testing |
sdk/keyvault/azure_security_keyvault_keys/README.md |
Refactored code samples to be testable with labeled rust ignore blocks |
sdk/keyvault/azure_security_keyvault_keys/Cargo.toml |
Added include-file and rand_chacha dev dependencies |
sdk/keyvault/azure_security_keyvault_certificates/tests/readme.rs |
New test file executing README code snippets for certificates client |
sdk/keyvault/azure_security_keyvault_certificates/README.md |
Refactored code samples to be testable with labeled rust ignore blocks |
sdk/keyvault/azure_security_keyvault_certificates/Cargo.toml |
Added include-file dev dependency |
sdk/keyvault/assets.json |
Updated assets tag to reflect test recording changes |
Cargo.toml |
Added include-file to workspace dependencies |
Cargo.lock |
Updated lock file with new dependencies and version updates |
Had to trick cryptographic operations to use a recorded seed.
5e3d035 to
f696d61
Compare
Also fixes up one paragraph in Secrets' README.md to be consistent with the others'.
Uses the
include_file::include_markdown!()macro to include otherwise non-compilable Rust code snippets from the README.md files.