{"record":{"id":"754f39cefd2de88d","repo":"BoundaryML/baml","slug":"unable-to-resolve-test-params","errorCode":null,"errorMessage":"Unable to resolve test params: {:?}","messagePattern":"Unable to resolve test params: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/lib.rs","lineNumber":812,"sourceCode":"\n        let eval_ctx = ctx.eval_ctx(strict);\n\n        match maybe_params {\n            Ok((params, function_params, span)) => {\n                let mut errors = Vec::new();\n                let params = params\n                    .into_iter()\n                    .map(|(k, v)| match v {\n                        Ok(v) => (k, v),\n                        Err(e) => {\n                            errors.push(e);\n                            (k, BamlValue::Null)\n                        }\n                    })\n                    .collect::<BamlMap<_, _>>();\n\n                if !errors.is_empty() {\n                    return Err(anyhow::anyhow!(\n                        \"Unable to resolve test params: {:?}\",\n                        errors\n                    ));\n                }\n\n                self.ir()\n                    .check_function_params(\n                        &function_params,\n                        &params,\n                        internal_baml_core::ir::ArgCoercer {\n                            span_path: span.map(|s| s.file.path_buf().clone()),\n                            allow_implicit_cast_to_string: true,\n                            skip_assert_eval: false,\n                        },\n                    )\n                    .map(|bv| bv.into_iter().map(|(k, v)| (k, v.value())).collect())\n            }\n            Err(e) => Err(anyhow::anyhow!(\"Unable to resolve test params: {:?}\", e)),","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/lib.rs#L794-L830","documentation":"get_test_params_impl evaluates a test case's parameter expressions and collects any per-parameter errors into a map. If any parameter fails to evaluate, the runtime aggregates them and returns 'Unable to resolve test params' with a debug dump of the errors, rather than producing a partial parameter set.","triggerScenarios":"Running a BAML test whose parameters reference undefined variables, functions producing errors, expressions with type errors, or calls that can't be evaluated in the test context (checked path where errors is non-empty).","commonSituations":"Typo'd or renamed variables in test-case args, test params depending on other functions that fail, missing test inputs after refactoring function signatures.","solutions":["Read the debug-printed errors map to see which parameters failed and why","Fix the failing parameter expressions in the test case (typos, missing variables, wrong types)","Ensure referenced functions/variables in test args exist in the current baml_src","Re-run `baml test` locally to confirm all params resolve before CI"],"exampleFix":"// before (baml_src test)\ntest TestGreet {\n  functions=[Greet]\n  args { name = userNmae } // typo\n}\n// after\ntest TestGreet {\n  functions=[Greet]\n  args { name = userName }\n}","handlingStrategy":"validation","validationCode":"// Before running tests, ensure all test arg identifiers exist in baml_src\n// baml-cli equivalent: `baml test --function Greet` fails fast with better messages","typeGuard":null,"tryCatchPattern":"match rt.get_test_params(fn_name, test_name) {\n    Ok(params) => params,\n    Err(e) if e.to_string().contains(\"Unable to resolve test params\") => {\n        eprintln!(\"Fix test args in baml_src: {e:#}\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run `baml test` locally before CI","Grep test-case args for identifiers after renaming variables","Keep test args in sync with function signatures"],"tags":["rust","testing","parameters","evaluation"],"backgroundTag":"invalid-argument-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}