Skip to content

Commit

Permalink
feat(rust): Update disable running benchmarks with nextest and `llv…
Browse files Browse the repository at this point in the history
…m-cov` (#339)

* update cargo config.toml file

* wip
  • Loading branch information
Mr-Leshiy authored Oct 25, 2024
1 parent 6f05e44 commit dce4d12
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion earthly/rust/scripts/std_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def cargo_llvm_cov(

def cargo_bench(flags: str, verbose: bool = False) -> exec_manager.Result:
return exec_manager.cli_run(
"cargo bench " + f"{flags} ",
"cargo bench --all-targets --no-fail-fast" + f"{flags} ",
name="Benchmarks all run to completion check",
verbose=verbose,
)
Expand Down
4 changes: 2 additions & 2 deletions earthly/rust/stdcfgs/cargo_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ lint-vscode = "clippy --message-format=json-diagnostic-rendered-ansi --all-targe

docs = "doc --release --no-deps --document-private-items --bins --lib --examples"
# nightly docs build broken... when they are'nt we can enable these docs... --unit-graph --timings=html,json -Z unstable-options"
testunit = "nextest run --release --bins --lib --tests --benches --no-fail-fast -P ci"
testcov = "llvm-cov nextest --release --bins --lib --tests --benches --no-fail-fast -P ci"
testunit = "nextest run --release --bins --lib --tests --no-fail-fast -P ci"
testcov = "llvm-cov nextest --release --bins --lib --tests --no-fail-fast -P ci"
testdocs = "test --doc --release"

# Rust formatting, MUST be run with +nightly
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ lint-vscode = "clippy --message-format=json-diagnostic-rendered-ansi --all-targe

docs = "doc --release --no-deps --document-private-items --bins --lib --examples"
# nightly docs build broken... when they are'nt we can enable these docs... --unit-graph --timings=html,json -Z unstable-options"
testunit = "nextest run --release --bins --lib --tests --benches --no-fail-fast -P ci"
testcov = "llvm-cov nextest --release --bins --lib --tests --benches --no-fail-fast -P ci"
testunit = "nextest run --release --bins --lib --tests --no-fail-fast -P ci"
testcov = "llvm-cov nextest --release --bins --lib --tests --no-fail-fast -P ci"
testdocs = "test --doc --release"

# Rust formatting, MUST be run with +nightly
Expand Down
5 changes: 0 additions & 5 deletions examples/rust/crates/foo/benches/benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
//! Simple benchmark example
use criterion::{black_box, criterion_group, criterion_main, Criterion};

#[test]
fn test_fibonacci() {
assert_eq!(fibonacci(20), 6765);
}

/// fibonacci calculates the nth fibonacci number
fn fibonacci(n: u64) -> u64 {
match n {
Expand Down

0 comments on commit dce4d12

Please sign in to comment.