You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/skills/create-perf-test/SKILL.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
1
---
2
-
agent: "agent"
3
-
description: "Generate a new performance test"
2
+
name: create-perf-test
3
+
description: Generate a new performance test
4
+
disable-model-invocation: true
4
5
---
5
6
6
7
# Generate a new performance test
7
8
8
9
You will generate a new performance (perf) test under the `sdk/{service-directory}/{crate-name}/perf` directory as `${input:testName:perf_test_name}.rs` where:
9
10
10
-
-`{service-directory}` is the directory name under [sdk](../../sdk) for the current ${file} e.g., `core`.
11
+
-`{service-directory}` is the directory name under [sdk](../../../sdk) for the current ${file} e.g., `core`.
11
12
-`{crate-name}` is the crate directory name under `sdk/{service-directory}` for the current ${file} e.g., `azure_core`.
12
13
13
14
## Set up
@@ -24,9 +25,9 @@ These instructions only need to be done once. If changes described are already p
24
25
```
25
26
26
27
- Under the `{crate-name}` directory, add a `perf/perf_tests.rs` file that uses `azure_core_test::perf::PerfRunner` to register and run the crate's perf tests.
27
-
- Under the `{crate-name}` directory, copy [sdk/core/perf.yml](../../sdk/core/perf.yml) and change _only_ the following contents:
28
+
- Under the `{crate-name}` directory, copy [sdk/core/perf.yml](../../../sdk/core/perf.yml) and change _only_ the following contents:
28
29
- Change `ServiceDirectory` to match the `{service-directory}`.
29
-
- Under the `{crate-name}` directory, copy [sdk/core/perf-tests.yml](../../sdk/core/perf-tests.yml) and change _only_ the following contents:
30
+
- Under the `{crate-name}` directory, copy [sdk/core/perf-tests.yml](../../../sdk/core/perf-tests.yml) and change _only_ the following contents:
30
31
- Change `Service` to match the `{service-directory}`.
31
32
- Change `Project` to match the `{crate-name}`.
32
33
- Change the `PackageVersions` to replace `azure_core` with the `{crate-name}`.
@@ -38,7 +39,7 @@ For each new perf test:
38
39
- In `sdk/{service-directory}/{crate-name}/perf/${input:testName}.rs`:
39
40
- Add a type that implements `azure_core_test::perf::PerfTest`.
40
41
- Generate a perf test for the currently selected function in ${file} or specified client method name, if any.
41
-
- Use [sdk/keyvault/azure_security_keyvault_keys/perf/get_key.rs](../../sdk/keyvault/azure_security_keyvault_keys/perf/get_key.rs) or [sdk/storage/azure_storage_blob/perf/list_blob_test.rs](../../sdk/storage/azure_storage_blob/perf/list_blob_test.rs) as examples.
42
+
- Use [sdk/keyvault/azure_security_keyvault_keys/perf/get_key.rs](../../../sdk/keyvault/azure_security_keyvault_keys/perf/get_key.rs) or [sdk/storage/azure_storage_blob/perf/list_blob_test.rs](../../../sdk/storage/azure_storage_blob/perf/list_blob_test.rs) as examples.
42
43
- Define a `test_metadata()` function returning `PerfTestMetadata`, including any required command-line options.
43
44
- Separate setup, the measured operation, and cleanup in the `PerfTest` implementation.
44
45
- If credentials are needed, prefer the crate's existing perf-test pattern (for example `context.recording().credential()` or an existing helper) instead of introducing a new authentication flow.
Copy file name to clipboardExpand all lines: .github/skills/create-recorded-test/SKILL.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
---
2
-
agent: "agent"
3
-
description: "Generate a new recorded integration test"
2
+
name: create-recorded-test
3
+
description: Generate a new recorded integration test
4
+
disable-model-invocation: true
4
5
---
5
6
6
7
# Generate a new recorded integration test
7
8
8
9
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:
9
10
10
11
-`{repo-root}` is the root directory containing `Cargo.toml`.
11
-
-`{service-directory}` is the directory name under [sdk](../../sdk) for the current ${file} e.g., `keyvault`.
12
+
-`{service-directory}` is the directory name under [sdk](../../../sdk) for the current ${file} e.g., `keyvault`.
12
13
-`{crate-name}` is the crate directory name under `sdk/{service-directory}` for the current ${file} e.g., `azure_security_keyvault_secrets`.
13
14
14
15
## Set up
@@ -24,7 +25,7 @@ These instructions only need to be done once. If changes described are already p
24
25
```
25
26
26
27
- 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`.
27
-
- For manual Test Proxy usage or asset publishing, see [CONTRIBUTING.md](../../CONTRIBUTING.md) and the [Test Proxy documentation](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md).
28
+
- For manual Test Proxy usage or asset publishing, see [CONTRIBUTING.md](../../../CONTRIBUTING.md) and the [Test Proxy documentation](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md).
- Construct clients with `recording.var("{ENV_VAR}", None).as_str()`, `recording.credential()`, and `Some(options)`.
40
-
- Use [sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs](../../sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs) as the example for function signatures, `TestContext`, and required `ClientOptions` instrumentation.
41
+
- Use [sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs](../../../sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs) as the example for function signatures, `TestContext`, and required `ClientOptions` instrumentation.
41
42
- Generate one test per client method or scenario the user wants to cover. If multiple methods share setup and belong together, keep them in the same integration test file as separate `#[recorded::test]` functions.
42
43
- Prefer asserting on returned models or observable state instead of only checking success.
43
44
- Reuse existing crate patterns for imports, helper types, resource naming, and environment variables.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,12 +21,12 @@ Further discussion on or pull requests for these issues is highly valued, and we
21
21
## Using Copilot
22
22
23
23
This repository is [configured](https://code.visualstudio.com/docs/copilot/copilot-customization) to facilitate Copilot.
24
-
In addition to [general instructions](https://github.com/Azure/azure-sdk-for-rust/blob/main/AGENTS.md), you can find additional skills in [.github/skills](https://github.com/Azure/azure-sdk-for-rust/tree/main/.github/skills) or use `/{skill-name}` in Copilot; and prompts in [.github/prompts](https://github.com/Azure/azure-sdk-for-rust/tree/main/.github/prompts) or type `/{prompt-name}` in Copilot.
24
+
In addition to [general instructions](https://github.com/Azure/azure-sdk-for-rust/blob/main/AGENTS.md), you can find additional skills in [.github/skills](https://github.com/Azure/azure-sdk-for-rust/tree/main/.github/skills) or use `/{skill-name}` in Copilot.
25
25
26
26
To generate a new performance test, for example, you might prompt with:
27
27
28
28
```text
29
-
Using /perf-test generate a perf test for SecretClient::get_secret.
29
+
/create-perf-test generate a perf test for SecretClient::get_secret.
30
30
```
31
31
32
32
For comprehensive guidance on how AI agents should interact with this repository, including workflows, automation boundaries, and safety guidelines, see [AGENTS.md](https://github.com/Azure/azure-sdk-for-rust/blob/main/AGENTS.md).
@@ -376,10 +376,32 @@ Once all of the above steps are met, the following process will be followed:
376
376
377
377
### Performance Testing
378
378
379
-
Performance testing is supported via [criterion](https://bheisler.github.io/criterion.rs/book/criterion_rs.html)
380
-
There are samples of performance tests under `sdk/core/azure_core/benches` folder.
381
-
To execute the performance tests in `azure_core` folder you can run `cargo bench` in the `sdk/core/azure_core` folder.
382
-
The output of the tests will be presented in the command line as well as saved under the `target/criterion` folder.
379
+
See [sdk/storage/azure_storage_blob](https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/storage/azure_storage_blob) for examples of both types of performance tests.
380
+
381
+
#### Benchmarks
382
+
383
+
For on-demand micro-benchmarks, use [criterion](https://bheisler.github.io/criterion.rs/book/criterion_rs.html). Benchmark files go under `benches/` in the crate directory. Add the following to `Cargo.toml`:
384
+
385
+
```toml
386
+
[[bench]]
387
+
name = "{bench-name}"
388
+
harness = false
389
+
```
390
+
391
+
criterion requires `harness = false` to supply its own test harness.
392
+
393
+
#### Performance Tests
394
+
395
+
For scheduled performance tests that are compared across languages and tracked for regressions, use `azure_core_test::perf::PerfRunner`. These files go under `perf/` in the crate directory. Add the following to `Cargo.toml`:
396
+
397
+
```toml
398
+
[[bench]]
399
+
name = "perf"
400
+
path = "perf/perf_tests.rs"
401
+
harness = false
402
+
```
403
+
404
+
Use the `/create-perf-test` skill to generate a new performance test.
0 commit comments