Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli-test: Only copy args if necessary
✗ CI failure Lorenz Leutgeb committed 2 months ago
commit 6a56d70a5a3c4ffaee647f7569acf9878b7e9ed6
parent 8a702cf17494ac730a4e978e0d7dcea5cce55302
2 failed (2 total) View logs
1 file changed +8 -8
modified crates/radicle-cli-test/src/lib.rs
@@ -410,14 +410,6 @@ impl TestFormula {

            // For each command.
            for (i, assertion) in test.assertions.iter().enumerate() {
-
                // Expand environment variables.
-
                let mut args = assertion.args.clone();
-
                for arg in &mut args {
-
                    for (k, v) in run.envs() {
-
                        *arg = arg.replace(format!("${k}").as_str(), &v);
-
                    }
-
                }
-

                let location = assertion
                    .path
                    .file_name()
@@ -447,6 +439,14 @@ impl TestFormula {
                    continue;
                }

+
                // Expand environment variables.
+
                let mut args = assertion.args.clone();
+
                for arg in &mut args {
+
                    for (k, v) in run.envs() {
+
                        *arg = arg.replace(format!("${k}").as_str(), &v);
+
                    }
+
                }
+

                if !run.path().exists() {
                    log::warn!(target: "test", "{location}: Directory {} does not exist. Creating..", run.path().display());
                    fs::create_dir_all(run.path())?;