> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Test a Mission before it goes live

> Run sample cases against a Mission version. Nothing reaches your customers, and you see what would have been sent.

A **test** is a sample trigger plus what must happen and what must never happen. Run your tests before you publish a [Mission](https://docs.famulor.io/assistants/routines.md) version, for example a missed-call follow-up: the sample is a missed call, the Mission must draft a callback message, and it must never book an appointment.

Open **Milian Missions**, select a Mission, and open the **Tests** tab.

## Add tests

* **By hand.** Select **Add test**. Enter a sample trigger, the tools the Mission must call, the tools it must never call, and phrases the report or message must contain. A rubric is optional and tells the reviewer what a good result looks like.
* **From a failed run.** Open **Runs**, choose a failed or paused run, and select **Add as test**.
* **In the Milian chat.** Tell Milian when the Mission runs, what the result is, and what it must never do. Milian drafts tests from your three answers.
* **From a call.** Create a test from a call with the API or MCP. Phone numbers and email addresses are not stored in the test.

## Run a test

Select **Run test**. The cost shows first, and you confirm before it starts. A test run is billed like Milian usage, with your normal credits.

Nothing reaches customers. Messages, calls, bookings, CRM changes and workspace changes are only recorded and shown as **Not sent**, with the details that would have gone out. Reads use your real workspace data.

A run uses the Mission version you pick and its limits. At most 20 tests run at once. Web search is not available in a test run.

## Read the results

Checks run first: required and forbidden tools, required fields and required phrases. Then an independent reviewer from a different model family from the Mission's scores the tests that passed the checks or have a rubric.

Every test shows one verdict:

* **Passed**
* **Failed**
* **Needs review**: the reviewer is unavailable or timed out. A reviewer problem never gives **Passed**.

Select **Agree** or **Disagree** on each verdict. A run passes only when every test passes.

## Held-out tests

About 30% of your tests are held out when you add them. You see all of them and can change the marker. Milian never sees the content, expectations or results of held-out tests, only how many there are and how many passed. This keeps Milian from tuning a Mission to the answers.

## Badges and publishing

Mission cards and the publish review show the latest result for that exact version: **Passed**, **Failed** or **Untested**.

Publishing stays your decision. You can publish any version. Milian only suggests publishing a version whose test run passed.

## Limits

* 50 tests per Mission.
* 20 tests per run.
* Results are kept for 90 days.
* A test built from a call is deleted with that call.

Workspace members can read tests and results. Owners and admins create, change and run them.

## API, MCP and CLI

| REST | MCP tool | Scope |
| - | - | - |
| `GET /api/v1/routines/{id}/tests/cases` | `list_routine_test_cases` | `routines:read` |
| `POST /api/v1/routines/{id}/tests/cases` | `create_routine_test_cases` | `routines:write` |
| `PATCH /api/v1/routines/{id}/tests/cases/{caseId}` | `update_routine_test_case` | `routines:write` |
| `DELETE /api/v1/routines/{id}/tests/cases/{caseId}` | `delete_routine_test_case` | `routines:write` |
| `GET /api/v1/routines/{id}/tests/estimate` | `estimate_routine_test_run` | `routines:read` |
| `POST /api/v1/routines/{id}/tests/runs` | `start_routine_test_run` | `routines:write` |
| `GET /api/v1/routines/{id}/tests/runs` | `list_routine_test_runs` | `routines:read` |
| `GET /api/v1/routines/{id}/tests/runs/{runId}` | `get_routine_test_run` | `routines:read` |
| `PUT /api/v1/routines/{id}/tests/runs/{runId}/results/{resultId}/verdict` | `set_routine_test_verdict` | `routines:write` |

Call the estimate first and pass its credits as `expected_credits` when you start a run. Get the version id with `famulor list-routine-versions <routine-id>`.

```bash theme={null}
famulor list-routine-test-cases <routine-id>
famulor create-routine-test-case <routine-id> --title "Missed call"
famulor estimate-routine-test-run <routine-id> --version-id <version-id>
famulor start-routine-test-run <routine-id> --version-id <version-id> --expected-credits <credits>
famulor get-routine-test-run <routine-id> <run-id>
famulor set-routine-test-verdict <routine-id> <run-id> <result-id> --verdict agree
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.