llama-stack-mirror/tests/unit
Alexey Rybak 8f57b08f2c
fix(build): always pass path when no template/config provided (#1982)
# What does this PR do?

Fixes a crash that occurred when building a stack as a container image
via the interactive wizard without supplying --template or --config.

- Root cause: template_or_config was None; only the container path
relies on that parameter, which later reaches subprocess.run() and
triggers

`TypeError: expected str, bytes or os.PathLike object, not NoneType.`

- Change: in `_run_stack_build_command_from_build_config` we now fall
back to the freshly‑written build‑spec file whenever both optional
sources are missing. Also adds a spy‑based unit test that asserts a
valid string path is passed to build_image() for container builds.

### Closes #1976

## Test Plan

- New unit test: test_build_path.py. Monkey‑patches build_image,
captures the fourth argument, and verifies it is a real path
- Manual smoke test: 

```
llama stack build --image-type container
# answer wizard prompts

```

Build proceeds into Docker without raising the previous TypeError.

## Future Work
Harmonise `build_image` arguments so every image type receives the same
inputs, eliminating this asymmetric special‑case.
2025-04-17 10:20:43 +02:00
..
cli refactor: tests/unittests -> tests/unit; tests/api -> tests/integration 2025-03-04 09:57:00 -08:00
distribution fix(build): always pass path when no template/config provided (#1982) 2025-04-17 10:20:43 +02:00
models feat: support '-' in tool names (#1807) 2025-04-12 14:23:03 -07:00
providers fix: Do not send an empty 'tools' list to remote vllm (#1957) 2025-04-15 20:31:12 -04:00
rag chore: Get sqlite_vec and vector_store unit tests passing (#1413) 2025-03-05 13:20:13 -05:00
registry fix: handle registry errors gracefully (#1732) 2025-03-20 15:24:07 -07:00
server feat(server): add attribute based access control for resources (#1703) 2025-03-19 21:28:52 -07:00