(workload: &WorkloadDefinition)
| 103 | } |
| 104 | |
| 105 | async fn assert_expected_pass(workload: &WorkloadDefinition) { |
| 106 | let mut args = vec![ |
| 107 | "--gpu".to_string(), |
| 108 | "--from".to_string(), |
| 109 | workload.image.clone(), |
| 110 | "--".to_string(), |
| 111 | ]; |
| 112 | args.extend(workload.command.clone()); |
| 113 | let arg_refs = args.iter().map(String::as_str).collect::<Vec<_>>(); |
| 114 | |
| 115 | let mut guard = create_workload_sandbox(&arg_refs) |
| 116 | .await |
| 117 | .unwrap_or_else(|err| { |
| 118 | panic!( |
| 119 | "GPU workload '{}' expected success but sandbox create failed:\n{err}", |
| 120 | workload.name |
| 121 | ) |
| 122 | }); |
| 123 | |
| 124 | let clean_output = strip_ansi(&guard.create_output); |
| 125 | guard.cleanup().await; |
| 126 | |
| 127 | assert!( |
| 128 | clean_output.contains(GPU_WORKLOAD_SUCCESS_MARKER), |
| 129 | "expected success marker {GPU_WORKLOAD_SUCCESS_MARKER} for workload '{}' image {} in sandbox output:\n{clean_output}", |
| 130 | workload.name, |
| 131 | workload.image, |
| 132 | ); |
| 133 | } |
| 134 | |
| 135 | async fn assert_expected_fail(workload: &WorkloadDefinition) { |
| 136 | let mut args = vec![ |
no test coverage detected