Skip to main content

Overview

Executes test commands and filters output to show only failures and summary. Supports all major test frameworks with intelligent parsing.

Syntax

Arguments

string[]
required
Full test command to execute (e.g., cargo test, pytest, npm test)

Supported Test Frameworks

Rust - Cargo Test

Detects:
  • Test result summary
  • Failed test names
  • Failure details

Python - Pytest

Detects:
  • Passed/failed/error counts
  • Failed test names
  • Assertion failures

JavaScript - Jest/Vitest

Detects:
  • Test Suites summary
  • Tests summary
  • Failed test names (marked with ✕)

Go - Go Test

Detects:
  • PASS/FAIL lines
  • Failed test output
  • Coverage summary

Output Format

With Failures

All Passing

With Errors

Token Savings

90% reduction - only failures and summary shown

Behavior Details

Failure Detection

RTK detects failures via multiple patterns:
  • Lines containing FAILED, ERROR, FAIL
  • Lines containing ✕, ✗, ❌
  • Assertion failures and panic messages
  • Test framework-specific markers

Summary Extraction

Extracts key summary lines:
  • test result: (Rust)
  • Tests:, Test Suites: (Jest/Vitest)
  • passed, failed, error counts (Pytest)
  • ok, FAIL lines (Go)

Fallback Behavior

If no framework-specific patterns match:
  • Shows last 5 lines of output
  • Preserves exit code
  • Still provides token reduction

Tee Output Recovery

On failure (exit code ≠ 0), RTK automatically saves full output and prints a hint:
Read the full output without re-running:

Exit Codes

Preserves the original test command exit code:
  • 0 - All tests passed
  • 1 - Some tests failed
  • 101 - Compilation error (Rust)
  • Other codes preserved as-is
  • rtk cargo test - Rust-specific test filter (90% savings)
  • rtk vitest run - Vitest-specific filter (99.5% savings)
  • rtk playwright test - Playwright-specific filter (94% savings)
  • rtk pytest - Pytest-specific filter (90% savings)
  • rtk err - Show only errors from any command