Skip to content

Commit

Permalink
move windsock to bench
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Aug 20, 2023
1 parent 989b802 commit 6ee96f8
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ rustflags = [
linker = "aarch64-linux-gnu-gcc"

[alias]
windsock = "run --release --example windsock --"
windsock = "test --release --bench windsock --features alpha-transforms --"
windsock-debug = "test --bench windsock --features alpha-transforms --"
4 changes: 4 additions & 0 deletions shotover-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ time = { version = "0.3.25" }
# Include WIP alpha transforms in the public API
alpha-transforms = ["shotover/alpha-transforms"]
cassandra-cpp-driver-tests = ["test-helpers/cassandra-cpp-driver-tests"]

[[bench]]
name = "windsock"
harness = false
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::{
};
use test_helpers::docker_compose::get_image_waiters;
use tokio::sync::RwLock;
use tokio_bin_process::bin_path;
use tokio_bin_process::event::{Event, Level};
use windsock::ReportArchive;

Expand Down Expand Up @@ -128,35 +129,11 @@ sudo apt-get install -y sysstat"#,
)
.await;

// PROFILE is set in build.rs from PROFILE listed in https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
let profile = if env!("PROFILE") == "release" {
"release"
} else {
"dev"
};
let output = tokio::process::Command::new(env!("CARGO"))
.args(["build", "--all-features", "--profile", profile])
.output()
.await
.unwrap();
if !output.status.success() {
let stdout = String::from_utf8(output.stdout).unwrap();
let stderr = String::from_utf8(output.stderr).unwrap();
panic!("Bench run failed:\nstdout:\n{stdout}\nstderr:\n{stderr}")
}
let local_shotover_path = bin_path!("shotover-proxy");
instance
.instance
.ssh()
.push_file(
&std::env::current_exe()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.join("shotover-proxy"),
Path::new("shotover-bin"),
)
.push_file(local_shotover_path, Path::new("shotover-bin"))
.await;
instance
.instance
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions shotover-proxy/build.rs

This file was deleted.

0 comments on commit 6ee96f8

Please sign in to comment.