Skip to content
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

treat benchmarks as normal tests #283

Merged
merged 2 commits into from
Jun 20, 2022
Merged

Conversation

tabokie
Copy link
Contributor

@tabokie tabokie commented Jun 19, 2022

Signed-off-by: tabokie xy.tao@outlook.com

Last I checked this behavior is consistent with cargo test. Bench cases that appear in test binary list should be considered a normal test.

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@sunshowers
Copy link
Member

Thanks for the PR!

What happens if a benchmark is invoked? Is it run just once or many times?

Note that the most popular benchmarking library criterion.rs doesn't currently work with nextest: bheisler/criterion.rs#562

@tabokie
Copy link
Contributor Author

tabokie commented Jun 20, 2022

@sunshowers In the case of cargo test, all #[bench] benches will behave just like normal unit tests (run just once). They will be run even if --tests is passed. Cases managed by criterion.rs will not be run, because they are not contained in the test binary generated by cargo test.

@sunshowers
Copy link
Member

sunshowers commented Jun 20, 2022

Thanks -- in that case this makes sense. I'll add a note to the release notes explaining that criterion still won't work but this diff doesn't make the situation any worse.

I'll also add some integration tests (using a magic env var to use nightly features on stable rust, but just for the tests...)

@sunshowers sunshowers merged commit b049c8d into nextest-rs:main Jun 20, 2022
sunshowers added a commit to sunshowers/nextest that referenced this pull request Jun 20, 2022
Test out the new capability to test benchmarks, added in nextest-rs#283.

RUSTC_BOOTSTRAP is required to test this out, but we're not using it in
any production code.
sunshowers added a commit that referenced this pull request Jun 21, 2022
Test out the new capability to test benchmarks, added in #283.

RUSTC_BOOTSTRAP is required to test this out, but we're not using it in
any production code.
@sunshowers
Copy link
Member

This is now out as cargo-nextest 0.9.22 (binaries will be out shortly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants