Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/rocm/src/advised_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,11 @@ const NOT_INVOCATIONS: &[(&str, &str, &str)] = &[
"rocm debug: command capture {stage} failed for {}: {detail}",
"debug log line",
),
(
"crates/rocm-core/src/host_gpu/capture.rs",
"rocm debug: command capture output from {} may be incomplete: {note}",
"debug log line",
),
(
"crates/rocm-dash-tui/src/ui/command_screen.rs",
"rocm {}",
Expand Down
10 changes: 5 additions & 5 deletions apps/rocm/src/chat/mcp_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,14 @@ fn run_rocm_command_for_paths(
_timeout: Duration,
) -> Result<CommandCapture> {
match run_rocm_read_only_in_process(paths, args) {
Ok(stdout) => Ok(CommandCapture {
argv: std::iter::once("rocm".to_owned())
Ok(stdout) => Ok(CommandCapture::from_text(
std::iter::once("rocm".to_owned())
.chain(args.iter().cloned())
.collect(),
exit_status: 0,
0,
stdout,
stderr: String::new(),
}),
String::new(),
)),
Err(error) => Err(error).with_context(|| {
format!(
"read-only assistant command is not implemented in-process: {}",
Expand Down
60 changes: 30 additions & 30 deletions apps/rocmd/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,12 @@ mod tests {

#[test]
fn sandbox_check_updates_value_is_read_only_and_preserves_output() {
let value = sandbox_check_updates_value(CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n runtime release status=up_to_date\n".to_owned(),
stderr: String::new(),
});
let value = sandbox_check_updates_value(CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n runtime release status=up_to_date\n".to_owned(),
String::new(),
));

assert_eq!(
value.get("tool").and_then(Value::as_str),
Expand All @@ -894,12 +894,12 @@ mod tests {

#[test]
fn sandbox_check_updates_value_marks_runtime_update_available() {
let value = sandbox_check_updates_value(CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n runtime release-pip-gfx120x-all status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
stderr: String::new(),
});
let value = sandbox_check_updates_value(CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n runtime release-pip-gfx120x-all status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
String::new(),
));

assert_eq!(
value.get("tool").and_then(Value::as_str),
Expand Down Expand Up @@ -933,12 +933,12 @@ mod tests {

#[test]
fn sandbox_check_updates_value_marks_runtime_repair_available() {
let value = sandbox_check_updates_value(CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n runtime release-wheel-multi-arch-7-14-0 status=repair_available installed=7.14.0 latest=7.14.0\n".to_owned(),
stderr: String::new(),
});
let value = sandbox_check_updates_value(CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n runtime release-wheel-multi-arch-7-14-0 status=repair_available installed=7.14.0 latest=7.14.0\n".to_owned(),
String::new(),
));

assert_eq!(
value.get("status").and_then(Value::as_str),
Expand All @@ -961,12 +961,12 @@ mod tests {

#[test]
fn a_newer_version_outranks_a_composition_repair_in_the_watcher_report() {
let value = sandbox_check_updates_value(CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n runtime old status=repair_available installed=7.14.0 latest=7.14.0\n runtime stale status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
stderr: String::new(),
});
let value = sandbox_check_updates_value(CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n runtime old status=repair_available installed=7.14.0 latest=7.14.0\n runtime stale status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
String::new(),
));

assert_eq!(
value.get("status").and_then(Value::as_str),
Expand All @@ -976,18 +976,18 @@ mod tests {

#[test]
fn sandbox_driver_plan_value_is_read_only_and_preserves_output() {
let value = sandbox_driver_plan_value(CommandCapture {
argv: vec![
let value = sandbox_driver_plan_value(CommandCapture::from_text(
vec![
"rocm".to_owned(),
"install".to_owned(),
"driver".to_owned(),
"--dkms".to_owned(),
"--dry-run".to_owned(),
],
exit_status: 0,
stdout: "driver install plan\n supported: true\n".to_owned(),
stderr: String::new(),
});
0,
"driver install plan\n supported: true\n".to_owned(),
String::new(),
));

assert_eq!(
value.get("tool").and_then(Value::as_str),
Expand Down
12 changes: 6 additions & 6 deletions apps/rocmd/src/watchers/driver_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,18 @@ mod tests {
&event,
|_paths| {
Ok(crate::sandbox::sandbox_driver_plan_value(
rocm_core::CommandCapture {
argv: vec![
rocm_core::CommandCapture::from_text(
vec![
"rocm".to_owned(),
"install".to_owned(),
"driver".to_owned(),
"--dkms".to_owned(),
"--dry-run".to_owned(),
],
exit_status: 0,
stdout: "driver install plan\n supported: true\n".to_owned(),
stderr: String::new(),
},
0,
"driver install plan\n supported: true\n".to_owned(),
String::new(),
),
))
},
)?;
Expand Down
24 changes: 12 additions & 12 deletions apps/rocmd/src/watchers/therock_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ mod tests {
&event,
|_paths| {
Ok(crate::sandbox::sandbox_check_updates_value(
rocm_core::CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n managed runtimes: none\n".to_owned(),
stderr: String::new(),
},
rocm_core::CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n managed runtimes: none\n".to_owned(),
String::new(),
),
))
},
)?;
Expand Down Expand Up @@ -319,12 +319,12 @@ mod tests {
&mut state,
&event,
|_paths| {
Ok(crate::sandbox::sandbox_check_updates_value(rocm_core::CommandCapture {
argv: vec!["rocm".to_owned(), "update".to_owned()],
exit_status: 0,
stdout: "update\n runtime release-pip-gfx120x-all status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
stderr: String::new(),
}))
Ok(crate::sandbox::sandbox_check_updates_value(rocm_core::CommandCapture::from_text(
vec!["rocm".to_owned(), "update".to_owned()],
0,
"update\n runtime release-pip-gfx120x-all status=update_available installed=7.13.0 latest=7.14.0\n".to_owned(),
String::new(),
)))
},
)?;

Expand Down
Loading
Loading