mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(test_utils): Add custom-headers and custom delay support to rustman (#2636)
This commit is contained in:
@ -3,10 +3,10 @@ use std::process::{exit, Command};
|
||||
use test_utils::newman_runner;
|
||||
|
||||
fn main() {
|
||||
let mut newman_command: Command = newman_runner::command_generate();
|
||||
let mut runner = newman_runner::generate_newman_command();
|
||||
|
||||
// Execute the newman command
|
||||
let output = newman_command.spawn();
|
||||
let output = runner.newman_command.spawn();
|
||||
let mut child = match output {
|
||||
Ok(child) => child,
|
||||
Err(err) => {
|
||||
@ -16,6 +16,30 @@ fn main() {
|
||||
};
|
||||
let status = child.wait();
|
||||
|
||||
if runner.file_modified_flag {
|
||||
let git_status = Command::new("git")
|
||||
.args([
|
||||
"restore",
|
||||
format!("{}/event.prerequest.js", runner.collection_path).as_str(),
|
||||
])
|
||||
.output();
|
||||
|
||||
match git_status {
|
||||
Ok(output) => {
|
||||
if output.status.success() {
|
||||
let stdout_str = String::from_utf8_lossy(&output.stdout);
|
||||
println!("Git command executed successfully: {stdout_str}");
|
||||
} else {
|
||||
let stderr_str = String::from_utf8_lossy(&output.stderr);
|
||||
eprintln!("Git command failed with error: {stderr_str}");
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Error running Git: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let exit_code = match status {
|
||||
Ok(exit_status) => {
|
||||
if exit_status.success() {
|
||||
|
||||
Reference in New Issue
Block a user