test-runner

A testing guide for the Membrane API Gateway Maven project, which is split into several related modules.

In plain words
What is it for?
Use it to run all tests, test one module and its dependencies, isolate a core test class or package, or run a single distribution or tutorial example.
Why use it?
It avoids Maven test commands that appear to work but run the wrong tests, skip the requested test, or fail because of language settings or network-dependent tests.

Agent for Claude Code

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/membrane/api-gateway/test-runner
Clone the repo
git clone --depth 1 https://github.com/membrane/api-gateway

Made for: Claude Code.

Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 983 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.00082 $0.00983
Opus 5 $0.00041 $0.00491
Sonnet 5 $0.00016 $0.00197
Haiku 4.5 $0.00008 $0.00098

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

Security

Grade A, and why

test-runner 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.

.claude/agents/test-runner.md · 70 lines

How it starts

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

You run tests in the Membrane API Gateway Maven multi-module reactor. Pick the right path below instead of reaching for the naive Maven command — this repo has several non-obvious traps where the naive command looks like it worked but either ran the wrong scope or skipped the target entirely.

1. Which kind of test is this?

A. Full or module-wide unit run (no isolation needed)

  • Whole repo: mvn test
  • One module + its deps: mvn -pl <module> -am test (e.g. -pl core -am test)
  • If failures look like locale-dependent string mismatches, add -Duser.language=en -Duser.country=US — macOS ignores LANG/LC_ALL for the JVM. Avoid -am when only running core/test tests if you don't need to rebuild annot: SpringConfigXSDErrorsTest there asserts English javac diagnostics and fails under a non-English JVM locale.

B. One test class or package inside core -Dtest=ClassName does NOT isolate it. core's surefire is bound to UnitTests.java, a JUnit Platform @Suite with @SelectPackages("com.predic8") — the suite engine ignores Surefire's class filter and runs the whole package regardless (including network-dependent tests that fail offline), while the target class's own line in the report shows Tests run: 0. That silent-zero is the tell that this trap was hit.

To actually isolate one class or package, use the existing script instead of hand-rolling a launcher:

test/scripts/run-core-test.sh <fully.qualified.TestClassName|package.name>

It drives com.predic8.membrane.devtools.SingleTestRunner (a permanent JUnit Platform Launcher entry point under core/src/test/java) and matches Surefire's argLine/CWD so results agree with a real Maven run. Requires the reactor to already be built once (mvn install -DskipTests at the repo root).

C. A distribution/tutorial example test (*ExampleTest / *TutorialTest under com.predic8.membrane.examples.* / com.predic8.membrane.tutorials.*) These are Failsafe ITs that unzip and run the built distribution zip, not the source tree — edits to core, config, or tutorials are invisible until it's rebuilt. -Dit.test doesn't filter them either (same suite trick, via the hardcoded ExampleTests.java). Don't hand-roll this — use the existing skill:

.claude/skills/run-example-test/run-example-test.sh [-b] <TestClassName>

Pass -b (or delete distribution/target/*.zip) if core or another upstream module changed since the last build.

Read the full file on GitHub · 70 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 · 70 lines · 82 tokens per session scan A cba0b9627c4f

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository membrane/api-gateway (638 stars, last pushed 2d ago), licensed Apache-2.0. It adds 82 tokens to every session and 983 once invoked, about $0.0004 per session on Opus 5. 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-30.