Azure / Azure/azure-sdk-for-rust
Add `#[perf::bench]` macro for perf tests needing real resources
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 112
Description
Rather than ignoring benchmarks in general by *not* passing `--benches` to `cargo test` in our pipelines - which then also means devs have to do that instead of just running `cargo test` - we should add a `#[perf::bench]` attribute-like proc macro that at least makes sure the resources are deployed.
The perf pipeline should already support deploying tests, so I don't think we need to - nor want to, for expediency and dev ease - do that. But we could make it key off the existence of `.env` files now that the changes to write those from `New-TestResources.ps1` have gone into Azure/azure-sdk-tools and deployed to all our repos.
This means devs can just run `cargo test` and any resource-based benches will be properly ignored since rust has no facility other than `#[ignore]` to do so. It also means we can add non-resource-based benches if necessary and keep running those.
Will properly address issues with #2602.
Contributor guide
Assessment
This issue has not been assessed yet.