add tests and fix job impl

This commit is contained in:
Timur Gordon
2025-09-09 17:54:09 +02:00
parent 629d59f7db
commit d744c2cd16
21 changed files with 1067 additions and 393 deletions

View File

@@ -4,7 +4,7 @@ use std::panic;
use std::path::Path;
use rhai::{Engine, Dynamic};
use actor_system::AsyncWorker;
use runner_rust::AsyncRunner;
/// Recursively collect all .rhai files from a directory and its subdirectories
fn collect_rhai_files(dir: &Path, files: &mut Vec<std::path::PathBuf>) -> Result<(), Box<dyn std::error::Error>> {
@@ -113,7 +113,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
};
// Create a new engine instance and configure it with DSL modules
let mut engine_with_context = match create_configured_engine(db_path, i + 1, verbose) {
let engine_with_context = match create_configured_engine(db_path, i + 1, verbose) {
Ok(engine) => engine,
Err(e) => {
println!("\x1b[31m✗\x1b[0m {} ... \x1b[31mFAILED\x1b[0m (engine setup: {})", script_name, e);
@@ -185,7 +185,7 @@ fn create_configured_engine(db_path: &str, script_index: usize, verbose: bool) -
let mut engine = Engine::new();
// Register all DSL modules (same as OSIS engine configuration)
actor_system::register_sal_modules(&mut engine);
runner_rust::register_sal_modules(&mut engine);
// Set up job context tags (similar to execute_job_with_engine)
let mut db_config = rhai::Map::new();