- Home
- Skills
- Testing & Debugging
- Test Failure Report: failing test, file:line and code in 20
Works with the AI Agents you already use
Test Failure Report: failing test, file:line and code in 20
Your agent reads only the failing tests: name, file:line, message and the code at that line, instead of the whole log.
$5
Test Failure Report: failing test, file:line and code in 20
Example session with this skill installed
Run the tests and fix whatever is failing.
- Read your context and instructions
- Compiled the test failure report
Summary
2 of 32 tests failed. Both came from one bug in apply_discount: the percent was divided by 10 instead of 100. Fixed it in pricing.py; all 32 tests pass now.
1. Ran the tests
node .claude/skills/test-failure-report/scripts/test-report.mjs -- pytest -v
FAILED (exit 1): pytest -v
Failing tests (2):
1. tests/test_pricing.py:11 test_ten_percent: assert 0.0 == 180
2. tests/test_pricing.py:14 test_cart_with_discount: assert -200.0 == 160
Code at the errors:
tests/test_pricing.py:
9 |
10 | def test_ten_percent():
11 > assert apply_discount(200, 10) == 180
12 |
13 | def test_cart_with_discount():
tests/test_pricing.py:
12 |
13 | def test_cart_with_discount():
14 > assert cart_total([(50, 2), (25, 4)], 20) == 160
15 |
The raw pytest -v output was 60 lines; 30 of them were passing tests.
2. Found the cause
Both failures go through apply_discount. A 10% discount on 200 returned 0.0, so the whole total was subtracted: the percent is divided by 10.
3. Fixed it
def apply_discount(total, percent):
"""Return total after a percentage discount, rounded to cents."""
- return round(total - total * percent / 10, 2)
+ return round(total - total * percent / 100, 2)
The tests were correct, so they were not changed.
4. Verified
OK: command succeeded.
Output (last lines):
................................ [100%]
32 passed in 0.04s
Next steps
- Nothing required. If you want, add a test for a 100% discount so the boundary stays covered.
Connects securely to your tools. The creator never sees your data.
About this skill
When your agent runs tests, it reads everything: every passing test, progress output, ANSI color codes, framework stack frames. A 300-line log for one broken assertion. That burns context, and the agent often "fixes" the wrong line.
This skill makes the agent run tests through a small wrapper script that prints a failure-first report:
FAILED (exit 1): pytest -q
Failing tests (1):
1. tests/test_stats.py:6 test_even: assert 3 == 2.5
Code at the errors:
tests/test_stats.py:
5 | def test_even():
6 > assert median([1, 2, 3, 4]) == 2.5
What you get
- Failing tests listed first: name, file:line, the assertion message
- The code around each failure, with the exact line marked
- A shortened log that keeps the head, the tail and every error line, for setup and compile errors
- The same exit code as your test command, so your agent's pass/fail logic doesn't change
- Measured on a real node:test run: 322 lines in, 53 lines out
Supported
jest, vitest, node:test (including TAP output, which is what agents actually see when output is piped), pytest, unittest, dotnet test (xUnit, NUnit, MSTest), cargo test. Code context also for tsc, MSBuild, Go, gcc and Java errors. Unknown output is still cleaned and shortened.
Requirements
Node 18+. One file, zero dependencies, nothing to install. Works offline.
Where it comes from
This is the test-output handling from Agent Lolo, an open-source VS Code coding agent built for small local models (qwen2.5-coder 7B). On a 7B model, a clean failure report is the difference between fixing the bug and looping. Large models benefit the same way: fewer tokens, less guessing.
Author: Nodirbek Abdulaxadov. License: MIT.
Requires Node 18+. Piped stdin usage loses the test command's exit code. Project root must be correctly specified for relative file resolution.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 29 days ago
Requires
Permissions
Shell: runs the test command you give it (e.g. npm test), in your project folder. Read files: shows the few lines of code around each error location. It writes nothing and makes no network requests.