From f6ca5936f540febe7ddcc415a3a399c66ae50a09 Mon Sep 17 00:00:00 2001 From: Andrei Kashin Date: Fri, 16 Feb 2024 10:41:49 +0000 Subject: [PATCH] Fix NPM run on Windows CI --- cranelift/filetests/src/zkasm_runner.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cranelift/filetests/src/zkasm_runner.rs b/cranelift/filetests/src/zkasm_runner.rs index 25fade81929f..df14d5d389d5 100644 --- a/cranelift/filetests/src/zkasm_runner.rs +++ b/cranelift/filetests/src/zkasm_runner.rs @@ -74,15 +74,24 @@ pub fn run_zkasm_path(input_path: &Path) -> anyhow::Result> )?; let mut output_file = NamedTempFile::new()?; + let common_args = [ + "--prefix", + "../../tests/zkasm", + "test", + input_path.to_str().unwrap(), + output_file.path().to_str().unwrap(), + ]; + + #[cfg(target_os = "windows")] + let output = std::process::Command::new("cmd") + .args(["/C", "npm"]) + .args(common_args) + .output()?; + #[cfg(not(target_os = "windows"))] let output = std::process::Command::new("npm") - .args([ - "--prefix", - "../../tests/zkasm", - "test", - input_path.to_str().unwrap(), - output_file.path().to_str().unwrap(), - ]) + .args(common_args) .output()?; + if !output.status.success() { return Err(anyhow::anyhow!( "Failed to run `npm`: {}; stderr: {}",