{"record":{"id":"eff7d1693fe86dea","repo":"BoundaryML/baml","slug":"test-profile-name-was-requested-but-does-not-exist","errorCode":null,"errorMessage":"test profile `{name}` was requested, but {} does not exist","messagePattern":"test profile `(.+?)` was requested, but (.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/test_command.rs","lineNumber":640,"sourceCode":"            .transpose()\n            .with_context(|| {\n                format!(\n                    \"failed to read test profiles from {}\",\n                    project_root.join(\"baml.toml\").display()\n                )\n            })?;\n\n        let selected_name = if self.no_profile {\n            None\n        } else if let Some(name) = &self.profile {\n            Some(name.as_str())\n        } else {\n            manifest.as_ref().and_then(|m| m.test.default.as_deref())\n        };\n\n        let profile_args = if let Some(name) = selected_name {\n            let manifest = manifest.as_ref().ok_or_else(|| {\n                anyhow!(\n                    \"test profile `{name}` was requested, but {} does not exist\",\n                    project_root.join(\"baml.toml\").display()\n                )\n            })?;\n            let profile = manifest.test.profiles.get(name).ok_or_else(|| {\n                let available = if manifest.test.profiles.is_empty() {\n                    \"none configured\".to_string()\n                } else {\n                    manifest\n                        .test\n                        .profiles\n                        .keys()\n                        .map(String::as_str)\n                        .collect::<Vec<_>>()\n                        .join(\", \")\n                };\n                anyhow!(\n                    \"test profile `{name}` is not defined in {} (available: {available})\",","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/test_command.rs#L622-L658","documentation":"`baml test --profile <name>` (or a configured default profile) was requested, but there is no baml.toml manifest in the project root, so no profiles can be resolved. `resolve_invocation` looks up the parsed manifest text; when it is None but a profile name was selected, this error fires pointing at the missing `baml.toml` path.","triggerScenarios":"Running `baml test --profile <name>` (or `test.default` set elsewhere without a manifest) from a project root where `baml.toml` does not exist — `manifest` is `None` because no manifest text was loaded.","commonSituations":"Running `baml test` in a directory without baml.toml (or before initializing the project); a typo'd `--from` path pointing outside the project; CI configured to pass `--profile` but the manifest file isn't committed; the file was deleted or renamed (e.g. baml.yaml).","solutions":["Create a `baml.toml` in the project root and define the profile under `[test.profiles.<name>]`.","Run from (or point `--from` at) the directory containing the project's baml.toml.","Commit baml.toml to the repo so CI has it.","Drop `--profile` (or use `--no-profile`) if you don't need profile-specific args."],"exampleFix":"// before\nbaml test --profile ci   # no baml.toml\n// after (baml.toml)\n[test.profiles.ci]\nargs = [\"--include\", \"critical::*\"]\n// then\nbaml test --profile ci","handlingStrategy":"validation","validationCode":"// shell: ensure manifest exists and profile is defined before invoking\n[ -f baml.toml ] || { echo \"baml.toml missing in $(pwd)\"; exit 1; }\ngrep -q \"[test.profiles.$PROFILE]\" baml.toml || { echo \"profile $PROFILE undefined\"; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! baml test --profile \"$P\" 2>err.log; then\n  grep -q 'does not exist' err.log && { echo \"create baml.toml or check --from path\"; }\n  cat err.log; exit 1\nfi","preventionTips":["Always run baml test from a directory containing baml.toml.","Commit baml.toml to version control.","Verify --from points at the project root when used."],"tags":["cli","testing","config","profile","baml"],"backgroundTag":"config-file-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}