diff --git a/modules/tester/test_runner/Cargo.lock b/modules/tester/test_runner/Cargo.lock index 5f10a201..758ce80d 100644 --- a/modules/tester/test_runner/Cargo.lock +++ b/modules/tester/test_runner/Cargo.lock @@ -129,7 +129,7 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "kinode_process_lib" version = "0.5.0" -source = "git+ssh://git@github.com/uqbar-dao/process_lib.git?tag=v0.5.3-alpha#8de14aa7132e6b7992c720c6aae24a64e108779d" +source = "git+ssh://git@github.com/uqbar-dao/process_lib.git?rev=59da820#59da820e8468c1bab510536062828d4241528145" dependencies = [ "anyhow", "bincode", diff --git a/modules/tester/test_runner/Cargo.toml b/modules/tester/test_runner/Cargo.toml index dd1d32e3..a125be61 100644 --- a/modules/tester/test_runner/Cargo.toml +++ b/modules/tester/test_runner/Cargo.toml @@ -13,10 +13,10 @@ lto = true [dependencies] anyhow = "1.0" bincode = "1.3.3" +kinode_process_lib = { git = "ssh://git@github.com/uqbar-dao/process_lib.git", rev = "59da820" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -kinode_process_lib = { git = "ssh://git@github.com/uqbar-dao/process_lib.git", tag = "v0.5.3-alpha" } wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "efcc759" } [lib] diff --git a/modules/tester/test_runner/src/lib.rs b/modules/tester/test_runner/src/lib.rs index 36ae64e9..ba601de6 100644 --- a/modules/tester/test_runner/src/lib.rs +++ b/modules/tester/test_runner/src/lib.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use kinode_process_lib::{ await_message, our_capabilities, println, spawn, vfs, Address, Message, OnExit, ProcessId, - Request, Response, + Request, Response, vfs::{DirEntry, FileType}, }; mod tester_types; @@ -24,7 +24,7 @@ fn make_vfs_address(our: &Address) -> anyhow::Result
{ } fn handle_message(our: &Address) -> anyhow::Result<()> { - let message = await_message().unwrap(); + let message = await_message()?; match message { Message::Response { .. } => { @@ -32,13 +32,15 @@ fn handle_message(our: &Address) -> anyhow::Result<()> { } Message::Request { ref body, .. } => { match serde_json::from_slice(body)? { - tt::TesterRequest::Run { test_timeout, .. } => { + tt::TesterRequest::Run { ref test_names, test_timeout, .. } => { println!("test_runner: got Run"); + let dir_prefix = "tester:sys/tests"; + let response = Request::new() .target(make_vfs_address(&our)?) .body(serde_json::to_vec(&vfs::VfsRequest { - path: "/tester:sys/tests".into(), + path: dir_prefix.into(), action: vfs::VfsAction::ReadDir, })?) .send_and_await_response(test_timeout)? @@ -57,40 +59,43 @@ fn handle_message(our: &Address) -> anyhow::Result<()> { panic!("") }; - let caps_file_path = "tester:sys/tests/grant_capabilities.json"; - let caps_index = children.iter().position(|i| *i.path == *caps_file_path); - let caps_by_child: std::collections::HashMap