mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +00:00
Adapt test worker to profile flag (#2450)
closes #2194 cc @mrcnski --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -59,21 +59,22 @@ pub fn validate_candidate(
|
||||
///
|
||||
/// NOTE: This should only be called in dev code (tests, benchmarks) as it relies on the relative
|
||||
/// paths of the built workers.
|
||||
pub fn build_workers_and_get_paths(is_bench: bool) -> (PathBuf, PathBuf) {
|
||||
pub fn build_workers_and_get_paths() -> (PathBuf, PathBuf) {
|
||||
// Only needs to be called once for the current process.
|
||||
static WORKER_PATHS: OnceLock<Mutex<(PathBuf, PathBuf)>> = OnceLock::new();
|
||||
|
||||
fn build_workers(is_bench: bool) {
|
||||
fn build_workers() {
|
||||
let mut build_args = vec![
|
||||
"build",
|
||||
"--package=polkadot",
|
||||
"--bin=polkadot-prepare-worker",
|
||||
"--bin=polkadot-execute-worker",
|
||||
];
|
||||
if is_bench {
|
||||
// Benches require --release. Regular tests are debug (no flag needed).
|
||||
|
||||
if cfg!(build_type = "release") {
|
||||
build_args.push("--release");
|
||||
}
|
||||
|
||||
let mut cargo = std::process::Command::new("cargo");
|
||||
let cmd = cargo
|
||||
// wasm runtime not needed
|
||||
@@ -117,7 +118,7 @@ pub fn build_workers_and_get_paths(is_bench: bool) -> (PathBuf, PathBuf) {
|
||||
}
|
||||
}
|
||||
|
||||
build_workers(is_bench);
|
||||
build_workers();
|
||||
|
||||
Mutex::new((prepare_worker_path, execute_worker_path))
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user