rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Add separate rust_benchmark rule again?

Open CinchBlue opened this issue 2 years ago • 3 comments

Sometimes bench targets are run in a different context than a regular unit test and integration test -- for example, you might have a benchmark test to be run separately that requires external internet access with a different connection or configuration than an "isolated" integration test.

It would be useful to have a top-level definition to auto-tag + create a separate test suite meant for benchmarks.

CinchBlue avatar Dec 12 '23 18:12 CinchBlue

I'm not sure what this would realistically look like, as I suspect different people would want different tags and configuration settings, suggesting this is maybe better suited to individual repos rather than in the rules themselves.

Do you want to put together a proposal of what a shared definition could look like, for discussion?

illicitonion avatar Dec 12 '23 18:12 illicitonion

I'm still learning more about Bazel + rules_rust, so I don't think I have the chops to make a formal proposal yet. I thought I'd just file a tracking issue to just keep it in record until someone comments or picks it up (maybe me later).

CinchBlue avatar Dec 12 '23 19:12 CinchBlue

I will say that I've done some manual work to do auto-generation of Bazel targets + BUILD.bazel from Cargo manifests for in-repo workspaces, and I find myself wanting for auto-generation of targets like :tests vs. :integration_tests vs. :bench_EXECUTABLE1 vs. :bench_EXECUTABLE2 to mirror the different types of ways you can invoke cargo run and cargo test.

Custom test suites to run subsets of tests could be based off of the auto-generated targets per-crate.

CinchBlue avatar Dec 12 '23 19:12 CinchBlue