From 981c21af154a2c854b54151229ae89353f0fcd0b Mon Sep 17 00:00:00 2001 From: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:26:41 +0200 Subject: [PATCH] chore(deps): Update Rust dependencies Signed-off-by: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> --- functional-tests/Cargo.toml | 2 +- functional-tests/src/lib.rs | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/functional-tests/Cargo.toml b/functional-tests/Cargo.toml index e3373fe71..09cc2ca48 100644 --- a/functional-tests/Cargo.toml +++ b/functional-tests/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" authors = ["Adrian Utrilla "] [dependencies] -tempdir = "0.3.5" +tempfile = "3.12.0" serde = "1.0" serde_json = "1.0.133" serde_yaml = "0.9.34" diff --git a/functional-tests/src/lib.rs b/functional-tests/src/lib.rs index 223dab704..ccb7b4b86 100644 --- a/functional-tests/src/lib.rs +++ b/functional-tests/src/lib.rs @@ -1,11 +1,9 @@ +#[cfg_attr(test, macro_use)] +extern crate lazy_static; extern crate serde; extern crate serde_json; extern crate serde_yaml; -extern crate tempdir; -#[macro_use] -extern crate lazy_static; -#[macro_use] -extern crate serde_derive; +extern crate tempfile; #[cfg(test)] mod tests { @@ -19,7 +17,8 @@ mod tests { use std::io::{Read, Write}; use std::path::Path; use std::process::Command; - use tempdir::TempDir; + use tempfile::Builder; + use tempfile::TempDir; const SOPS_BINARY_PATH: &'static str = "./sops"; const KMS_KEY: &'static str = "FUNCTIONAL_TEST_KMS_ARN"; @@ -36,8 +35,10 @@ mod tests { } lazy_static! { - static ref TMP_DIR: TempDir = - TempDir::new("sops-functional-tests").expect("Unable to create temporary directory"); + static ref TMP_DIR: TempDir = Builder::new() + .prefix("sops-functional-tests") + .tempdir() + .expect("Unable to create temporary directory"); } fn prepare_temp_file(name: &str, contents: &[u8]) -> String { @@ -806,7 +807,7 @@ b: ba"# let file_path = "res/comments.yaml"; let output = Command::new(SOPS_BINARY_PATH) .arg("encrypt") - .arg(file_path.clone()) + .arg(file_path) .output() .expect("Error running sops"); assert!(output.status.success(), "SOPS didn't return successfully"); @@ -825,7 +826,7 @@ b: ba"# let file_path = "res/comments_list.yaml"; let output = Command::new(SOPS_BINARY_PATH) .arg("encrypt") - .arg(file_path.clone()) + .arg(file_path) .output() .expect("Error running sops"); assert!(output.status.success(), "SOPS didn't return successfully"); @@ -844,7 +845,7 @@ b: ba"# let file_path = "res/comments.enc.yaml"; let output = Command::new(SOPS_BINARY_PATH) .arg("decrypt") - .arg(file_path.clone()) + .arg(file_path) .output() .expect("Error running sops"); assert!(output.status.success(), "SOPS didn't return successfully"); @@ -863,7 +864,7 @@ b: ba"# let file_path = "res/comments_unencrypted_comments.yaml"; let output = Command::new(SOPS_BINARY_PATH) .arg("decrypt") - .arg(file_path.clone()) + .arg(file_path) .output() .expect("Error running sops"); assert!(output.status.success(), "SOPS didn't return successfully");