mcpls tests.instructions.md

Rust testing instructions for asynchronous code, external programs, filesystem and network sequences, path matching, and serialised data. Tests are small checks that confirm code behaves as expected.

In plain words
What is it for?
Writing genuine async tests, marking tests that need unavailable binaries, covering filesystem-to-network flows, testing absolute paths, and verifying every serialisation variant.
Why use it?
They focus tests on real failure cases instead of checks that pass while production behaviour remains broken.

Instructions file for GitHub Copilot

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 instructions/bug-ops/mcpls/tests
Clone the repo
git clone --depth 1 https://github.com/bug-ops/mcpls

Made for: GitHub Copilot.

Per session 425 This file is loaded in full into every session.
When invoked 425 The same file — it is already loaded in full.
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.00425 $0.00425
Opus 5 $0.00212 $0.00212
Sonnet 5 $0.00085 $0.00085
Haiku 4.5 $0.00042 $0.00042

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

Security

Grade A, and why

mcpls tests.instructions.md 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.

.github/instructions/tests.instructions.md · 41 lines

What it actually says

Test design

Tests for async code must use #[tokio::test] and exercise the actual async paths, not synchronous wrappers that bypass scheduler interactions. Concurrency bugs (lock contention, channel saturation) are only reachable through genuine async execution.

Tests that require an external binary must be marked #[ignore = "Requires <binary> in PATH"]. CI runners do not have language server binaries; an unmarked test will fail on every clean run.

Correctness invariants to cover

Any code path that pairs a filesystem operation with a subsequent network notification (open, close, re-open after external edit) must have a test that exercises the full sequence using a mock network client and a real temporary file — not just the filesystem primitive in isolation.

Glob matching tests must use absolute path strings as input. Passing a bare filename to a glob set will pass even when the production code fails on absolute paths, because globset anchoring behaviour differs between the two cases.

Round-trip tests for serialisable types must cover every variant, and must assert the serialised string value, not just that deserialisation succeeds. A rename_all typo produces a wrong on-disk format that round-trips correctly in isolation.

Idiomatic test code

Prefer assert_eq! over assert!(a == b)assert_eq! prints both values on failure, making diagnosis faster.

Use tempfile::tempdir() for tests that need real filesystem paths. Hard-coded /tmp paths cause test interference when multiple test threads run in parallel.

Prefer #[tokio::test] over tokio::runtime::Runtime::block_on in test bodies — block_on does not integrate with tokio's test utilities (time::pause, time::advance) needed for testing debounce and timeout logic.

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 · 41 lines · 425 tokens per session scan A e4d33a021f7c

Subscribe to this mod's changes

mcpls tests.instructions.md is an instructions file published in the GitHub repository bug-ops/mcpls (65 stars, last pushed 3d ago), licensed Apache-2.0. It adds 425 tokens to every session, about $0.0021 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.