running-tests

Executes Bun test suites safely with scope guards, per-file isolation loops, and failure classification.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/pandejesal/drone-nav-sar --skill running-tests-pandejesal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: running-tests
Source: https://github.com/pandejesal/drone-nav-sar/tree/main/.swarm/bundled-skills/running-tests
Command: npx skills add https://github.com/pandejesal/drone-nav-sar --skill running-tests-pandejesal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running tests at scale in the opencode-swarm project can trigger unbounded fan-out that blocks or kills the agent session, and failures are often misdiagnosed. This Skill provides safe test execution patterns that prevent session kills and help classify failures correctly. ## Core Features & Use Cases - Scope Safety Guards: Explains the three-layer defense (source-file count guard, fan-out estimate, budget-limited traversal) that returns scope_exceeded instead of hanging the session. - Per-File Isolation Loops: Provides ready-to-use bash and PowerShell loops for running Bun tests in per-file isolation, matching CI behavior for mock-heavy directories. - Failure Classification & Verification: Distinguishes stale assertions, soft regressions, genuine pre-existing failures, and new regressions, with git worktree commands to verify failures against main. - Use Case: After changing several source files, use the per-file shell loop instead of test_runner with multiple files to avoid scope_exceeded, then verify any failure against main before documenting it as pre-existing in the PR body. ## Quick Start Ask the agent to run the tests for the agents directory using a per-file isolation loop and classify any failures before pushing.

Frequently Asked Questions about running-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run tests for multiple changed files without killing the session?

Use a shell loop that runs one Bun test process per file instead of passing multiple files to test_runner. The test_runner tool rejects multi-file calls with scope_exceeded, while per-file loops with bun --smol test stay bounded.

When should I use test_runner versus a bun shell command?

Use test_runner only with a single source file for graph, impact, or convention scopes. For multiple files, whole directories, or full-repo validation, use shell commands like bun --smol test with per-file loops.

Why does test_runner return scope_exceeded?

scope_exceeded fires when more than one source file is passed or when the estimated fan-out exceeds 50 test files. It is a protective guard that prevents unbounded graph traversal from blocking the session.

How do I verify a test failure is pre-existing on main?

Create a throwaway checkout with git worktree add pointing at origin/main, run the failing test there, then remove the worktree. If it fails on main too, document it as pre-existing in the PR body; otherwise fix it before pushing.

Why do Bun tests fail on Windows with PowerShell syntax errors?

Bash loop syntax like for f in ...; do is invalid in PowerShell. Use Get-ChildItem piped to ForEach-Object, replace Select-String -Last with Select-Object -Last, and avoid && which PowerShell 5.1 does not support.

Why do tree-sitter tests time out and how should I handle it?

Tree-sitter tests load WASM grammar modules on first use, which takes several seconds per process. Use --timeout 60000 or higher for these files and classify the timeout as infrastructure delay before treating it as a code bug.