Skip to content

Commit

Permalink
fix err to append env value to default
Browse files Browse the repository at this point in the history
Signed-off-by: sat0ken <[email protected]>
  • Loading branch information
sat0ken committed Nov 13, 2024
1 parent d54912a commit fff5e2b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tests/contest/contest/src/tests/process/process_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ use test_framework::{test_result, Test, TestGroup, TestResult};
use crate::utils::test_inside_container;

fn create_spec() -> Result<Spec> {
let mut spec = SpecBuilder::default()
.process(
ProcessBuilder::default()
.args(vec!["runtimetest".to_string(), "process".to_string()])
.cwd("/test")
.build()
.expect("error in creating process config"),
)
let mut process = ProcessBuilder::default()
.args(vec!["runtimetest".to_string(), "process".to_string()])
.cwd("/test")
.build()
.expect("error in creating process config");
let mut env = process.env().clone().unwrap();
env.push("testa=valuea".to_string());
env.push("testb=123".to_string());
process.set_env(Some(env));

let spec = SpecBuilder::default()
.process(process)
.build()
.context("failed to build spec")?;
spec.process()
.set_env(vec!["testa=valuea".into(), "testb=123".into()]);

Ok(spec)
}

Expand Down

0 comments on commit fff5e2b

Please sign in to comment.