Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for lack of command in runtime only for wasmtime #2692

Merged
merged 2 commits into from
Aug 14, 2023
Merged
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
19 changes: 10 additions & 9 deletions agent/provider/src/execution/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,19 @@ impl OfferBuilder for ExeUnitDesc {
}

async fn test_runtime(exeunit_desc: &ExeUnitDesc, working_dir: &Path) -> anyhow::Result<()> {
let result = ExeUnitInstance::run_with_output(
let test_arg = match exeunit_desc.name.as_str() {
// Workaround: ya-runtime-wasi doesn't implement `test` command.
"wasmtime" => "--help",
// Default
_ => "test",
};

let _ = ExeUnitInstance::run_with_output(
&exeunit_desc.supervisor_path,
working_dir,
ExeUnitsRegistry::exeunit_args(exeunit_desc, vec!["test".into()])?,
ExeUnitsRegistry::exeunit_args(exeunit_desc, vec![test_arg.into()])?,
)
.await;
if let Err(err) = result {
let message = err.to_string();
if !message.contains("--help") {
anyhow::bail!(message);
}
}
.await?;
Ok(())
}

Expand Down
Loading