Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charmoniumQ committed Oct 16, 2024
1 parent 7f24339 commit 7f0f717
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions probe_src/frontend/cli/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ impl Recorder {
.arg("--args")
.arg(self_bin)
.arg("__gdb-exec-shim")
.args(if self.copy_files {std::vec!["--copy-files"]} else {std::vec![]})
.args(if self.copy_files {
std::vec!["--copy-files"]
} else {
std::vec![]
})
.args(&self.cmd)
.env_remove("__PROBE_LIB")
.env_remove("__PROBE_LOG")
Expand All @@ -162,7 +166,7 @@ impl Recorder {
.args(&self.cmd[1..])
.env_remove("__PROBE_LIB")
.env_remove("__PROBE_LOG")
.env("__PROBE_COPY_FILES", if self.copy_files {"1"} else {""})
.env("__PROBE_COPY_FILES", if self.copy_files { "1" } else { "" })
.env("__PROBE_DIR", self.output.path())
.env("LD_PRELOAD", ld_preload)
.spawn()
Expand Down
11 changes: 7 additions & 4 deletions probe_src/frontend/lib/src/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,13 @@ pub fn parse_tid<P1: AsRef<Path>, P2: AsRef<Path>>(in_dir: P1, out_dir: P2) -> R
std::fs::read(&ops_dat_file)
.wrap_err("Failed to read file from ops directory")
.and_then(|file_contents| {
OpsArena::from_bytes(file_contents, filename_numeric(&ops_dat_file).wrap_err("Error parsing numeric ops/$n.dat")?)
.wrap_err("Error constructing OpsArena")?
.decode(&ctx)
.wrap_err("Error decoding OpsArena")
OpsArena::from_bytes(
file_contents,
filename_numeric(&ops_dat_file).wrap_err("Error parsing numeric ops/$n.dat")?,
)
.wrap_err("Error constructing OpsArena")?
.decode(&ctx)
.wrap_err("Error decoding OpsArena")
})
})
// STEP 6
Expand Down
5 changes: 1 addition & 4 deletions probe_src/tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
import pathlib
import networkx as nx
from probe_py.manual.analysis import FileNode, ProcessNode, InodeOnDevice, provlog_to_digraph, validate_hb_graph
from probe_py.manual.analysis import FileNode, ProcessNode, InodeOnDevice
from probe_py.manual.workflows import NextflowGenerator


Expand Down Expand Up @@ -146,6 +146,3 @@ def test_dataflow_graph_to_nextflow_script() -> None:
script = re.sub(r'process_\d+', 'process_*', script)
expected_script = re.sub(r'process_\d+', 'process_*', expected_script)
assert script == expected_script

os.remove(a_file_path)
os.remove(b_file_path)

0 comments on commit 7f0f717

Please sign in to comment.