bots-garden/razorbillpublic Fork
⑂ v0.3.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
run-the-tests.md · 71 lines · 3.1 KBmarkdown
Blame HistoryOpen raw

How to run the tests

This guide runs razorbill's test suite and its quality check. It assumes the repository is cloned.

Run everything (one command)

From the repository root, on the Mac or on Linux:

scripts/test.sh
  • On the Mac it runs xcodebuild test on the razorbill scheme: every module, the MLX engine included.
  • On Linux it runs swift test --scratch-path .build/linux: everything except the MLX engine, which is only linked on macOS.

The script stops at the first failing command and returns its exit code.

Run part of the suite

On Linux (or on the Mac without the MLX module), use swift test filters:

swift test --scratch-path .build/linux --filter RazorbillCoreTests        # one test target
swift test --scratch-path .build/linux --filter ConfigLoader              # tests whose name matches

On the Mac, with xcodebuild:

xcodebuild test -scheme razorbill -destination 'platform=macOS' -derivedDataPath .build/xcode \
  -skipPackagePluginValidation -skipMacroValidation -only-testing:RazorbillMLXTests

Check compatibility with real OpenAI clients

scripts/compat.sh               # the whole suite
scripts/compat.sh -k tools      # extra arguments go to pytest

It starts rzb serve on port 18080 with a configuration of its own, runs Tests/Compatibility (pytest, with the openai library, LangChain, and the curl examples of the API reference) and stops the server. It needs uv, which installs the Python packages.

  • On the Mac the server runs MLX: pull mlx-community/Qwen3-4B-4bit and BAAI/bge-small-en-v1.5 first. mlx-community/Llama-3.2-3B-Instruct-4bit, when cached, adds the tests of a second tool-call family. The script rebuilds rzb (incrementally) before running.
  • On Linux the server runs the fake engine: the protocol is checked (shapes, streaming, errors) and the tests that need a real model are skipped.
  • Against a server you started: RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh. It must declare the ids chat and embed (and optionally unforced).
  • Other models: RZB_COMPAT_CHAT_SOURCE, RZB_COMPAT_EMBED_SOURCE, RZB_COMPAT_UNFORCED_SOURCE.

Run the tests of the host-runner tool

python3 -m unittest discover -s tools/host-runner

Check the code style and quality

swiftlint lint --quiet Sources Tests
swift-format lint -r Sources Tests
python3 .claude/skills/quality/scripts/quality_report.py --workspace .

The last command writes a report under .quality/ and exits with 0 when the quality gate passes.

Variants

  • From a Linux sandbox, for the Mac part: tools/host-runner/host.sh test . razorbill; see Develop from a Linux sandbox.
  • Tests with a real model (ChatSmokeTests, ConstrainedSmokeTests, EmbeddingSmokeTests, on the Mac) run only when their model is in the cache: mlx-community/Qwen3-0.6B-4bit, sentence-transformers/all-MiniLM-L6-v2, BAAI/bge-small-en-v1.5. Otherwise they are skipped.

See also

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# How to run the tests

This guide runs razorbill's test suite and its quality check. It assumes the repository is cloned.

## Run everything (one command)

From the repository root, on the Mac or on Linux:

```bash
scripts/test.sh
```

- **On the Mac** it runs `xcodebuild test` on the `razorbill` scheme: every module, the MLX engine included.
- **On Linux** it runs `swift test --scratch-path .build/linux`: everything except the MLX engine, which is only linked on macOS.

The script stops at the first failing command and returns its exit code.

## Run part of the suite

On Linux (or on the Mac without the MLX module), use `swift test` filters:

```bash
swift test --scratch-path .build/linux --filter RazorbillCoreTests        # one test target
swift test --scratch-path .build/linux --filter ConfigLoader              # tests whose name matches
```

On the Mac, with `xcodebuild`:

```bash
xcodebuild test -scheme razorbill -destination 'platform=macOS' -derivedDataPath .build/xcode \
  -skipPackagePluginValidation -skipMacroValidation -only-testing:RazorbillMLXTests
```

## Check compatibility with real OpenAI clients

```bash
scripts/compat.sh               # the whole suite
scripts/compat.sh -k tools      # extra arguments go to pytest
```

It starts `rzb serve` on port 18080 with a configuration of its own, runs `Tests/Compatibility` (pytest, with the `openai` library, LangChain, and the `curl` examples of the API reference) and stops the server. It needs [`uv`](https://docs.astral.sh/uv/), which installs the Python packages.

- **On the Mac** the server runs MLX: pull `mlx-community/Qwen3-4B-4bit` and `BAAI/bge-small-en-v1.5` first. `mlx-community/Llama-3.2-3B-Instruct-4bit`, when cached, adds the tests of a second tool-call family. The script rebuilds `rzb` (incrementally) before running.
- **On Linux** the server runs the fake engine: the protocol is checked (shapes, streaming, errors) and the tests that need a real model are skipped.
- **Against a server you started**: `RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh`. It must declare the ids `chat` and `embed` (and optionally `unforced`).
- Other models: `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.

## Run the tests of the host-runner tool

```bash
python3 -m unittest discover -s tools/host-runner
```

## Check the code style and quality

```bash
swiftlint lint --quiet Sources Tests
swift-format lint -r Sources Tests
python3 .claude/skills/quality/scripts/quality_report.py --workspace .
```

The last command writes a report under `.quality/` and exits with `0` when the quality gate passes.

## Variants

- **From a Linux sandbox, for the Mac part**: `tools/host-runner/host.sh test . razorbill`; see [Develop from a Linux sandbox](develop-from-a-sandbox.md).
- **Tests with a real model** (`ChatSmokeTests`, `ConstrainedSmokeTests`, `EmbeddingSmokeTests`, on the Mac) run only when their model is in the cache: `mlx-community/Qwen3-0.6B-4bit`, `sentence-transformers/all-MiniLM-L6-v2`, `BAAI/bge-small-en-v1.5`. Otherwise they are skipped.

## See also

- What each module does: [architecture](../explanation/architecture.md).