testing

A test suite for a coding project, using Vitest to check individual pieces of code and a coverage tool to show which parts the tests exercise.

In plain words
What is it for?
It checks tool definitions, request handlers, helper functions, file-system behavior, simulator data, Bazel build settings, workspace checks, and upgrade logic.
Why use it?
It helps catch broken behavior and missing test coverage before changes are released.

Agent for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/debugswift/xcodebazelmcp/testing
Clone the repo
git clone --depth 1 https://github.com/DebugSwift/XcodeBazelMCP

Made for: Codex.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 548 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00548
Opus 5 $0.00000 $0.00274
Sonnet 5 $0.00000 $0.00110
Haiku 4.5 $0.00000 $0.00055

Measured yesterday against content hash 7b2342c1bb2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/agents/testing.md · 31 lines

How it starts

The opening of the file, as written. The whole thing — 31 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing

Framework

230 unit tests via Vitest, coverage via @vitest/coverage-v8.

Test Organization

File Covers
bazel-tools.test.ts Tool name set (order-independent via .sort()), startupArgs schema, required fields, streaming flag, unknown tool rejection
handlers/handlers.test.ts Every handler exports non-empty definitions, canHandle correctness, handle returns undefined for unknown tools, no duplicates across handlers, total tool count (112)
helpers.test.ts stringOrUndefined, numberOrUndefined, prependWarning, applyDefaults (default merging vs explicit arg priority)
simulators.test.ts findAppBundle, readBundleId — uses real filesystem fixtures (.test-fixtures/ dir, created in beforeAll, cleaned in afterAll)
bazel.test.ts Arg builders, label validation, query sanitization, YAML config parsing (flat + nested profiles, enabledWorkflows, boolean/numeric values, comments, empty content, activateProfile errors)
workspace.test.ts assertBazelWorkspace (non-existent/file/missing markers/valid), readBspStatus (missing dir, valid JSON, malformed JSON)
upgrade.test.ts upgradeHint fallback, compareVersions edge cases, detectInstallMethod
MCP smoke test Server initializes without error

Key Conventions

  • All tests are pure unit tests — no actual Bazel builds or simulator boots in CI.
  • When refactoring handlers into separate modules, tool name ordering in tests must use .sort() since import order is not guaranteed.
  • Many tool handlers are hard to unit-test (they shell out to bazel, simctl, devicectl). E2E testing against example_projects/BazelApp is the primary validation.
  • MCP JSON-RPC can be tested by piping printf JSON lines into node dist/cli.js mcp. Use sleep between sequential calls since the server processes sequentially.

Known Test Infrastructure Issues

  • Global mutable config + configLoaded in runtime/config.ts leaks state across test files. No current tests call runBazel or assertBazelWorkspace so it doesn't cause failures — watch out when adding integration tests.
  • Module-level mutable counters (logCaptureCounter, videoRecordingCounter) in helpers.ts have no reset function. Tests share state across runs.

Read the full file on GitHub · 31 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 31 lines · 0 tokens per session scan A 7b2342c1bb2e

Subscribe to this mod's changes

testing is an agent published in the GitHub repository DebugSwift/XcodeBazelMCP (7 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 548 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories