askill
test-runner

test-runnerSafety 90Repository

Test runner checkpoint for conductor gates. Detects test framework (jest, pytest, cargo test, go test, etc.), runs tests, and captures output. Returns structured result with pass/fail status and failed test details.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Test Runner Checkpoint

Test execution checkpoint that auto-detects the project's test framework and runs tests.

What This Skill Does

  1. Detects test framework from project files
  2. Runs appropriate test command
  3. Parses test output for results
  4. Writes result to checkpoint file

Workflow

Step 1: Detect Test Framework

Check for test framework indicators:

# Node.js projects
ls package.json 2>/dev/null && cat package.json | grep -E '"test"|"jest"|"vitest"|"mocha"'

# Python projects
ls pytest.ini pyproject.toml setup.py requirements.txt 2>/dev/null

# Rust projects
ls Cargo.toml 2>/dev/null

# Go projects
ls go.mod 2>/dev/null

# General
ls Makefile 2>/dev/null && grep -E "^test:" Makefile

Framework Detection Priority:

IndicatorFrameworkCommand
package.json with "test" scriptnpmnpm test
package.json with vitestvitestnpm test or npx vitest
package.json with jestjestnpm test or npx jest
pytest.ini or conftest.pypytestpytest
pyproject.toml with pytestpytestpytest
Cargo.tomlcargocargo test
go.modgogo test ./...
Makefile with test targetmakemake test

Step 2: Run Tests

Execute the detected test command and capture output:

# Example for npm
npm test 2>&1 | tee /tmp/test-output.txt
TEST_EXIT_CODE=${PIPESTATUS[0]}
echo "Exit code: $TEST_EXIT_CODE"

# Example for pytest
pytest --tb=short 2>&1 | tee /tmp/test-output.txt
TEST_EXIT_CODE=${PIPESTATUS[0]}

# Example for cargo
cargo test 2>&1 | tee /tmp/test-output.txt
TEST_EXIT_CODE=${PIPESTATUS[0]}

Step 3: Parse Test Output

Extract test results from output. Common patterns:

Jest/Vitest:

Tests:       3 failed, 12 passed, 15 total

Pytest:

====== 2 failed, 10 passed in 1.23s ======

Cargo:

test result: FAILED. 8 passed; 2 failed; 0 ignored

Go:

FAIL    mypackage       0.123s

Step 4: Create Structured Result

{
  "checkpoint": "test-runner",
  "timestamp": "2026-01-19T12:00:00Z",
  "passed": false,
  "framework": "jest",
  "command": "npm test",
  "exit_code": 1,
  "summary_line": "Tests: 2 failed, 15 passed, 17 total",
  "failed_tests": [
    {
      "name": "UserService.login should validate credentials",
      "file": "src/services/user.test.ts",
      "error": "Expected 200 but got 401"
    }
  ],
  "stats": {
    "total": 17,
    "passed": 15,
    "failed": 2,
    "skipped": 0
  },
  "output": "[truncated test output...]"
}

Result Fields:

  • passed: true if all tests pass (exit code 0)
  • framework: detected test framework
  • command: exact command that was run
  • exit_code: process exit code
  • failed_tests: array of {name, file?, error?} for each failure
  • stats: test count statistics
  • output: raw output (truncated if very long)

Step 5: Write Checkpoint File

mkdir -p .checkpoints
cat > .checkpoints/test-runner.json << 'EOF'
{
  "checkpoint": "test-runner",
  ...
}
EOF

Decision Criteria

Pass if:

  • All tests pass (exit code 0)
  • Test output shows 0 failures

Fail if:

  • Any test fails
  • Tests fail to run (syntax error, missing deps)
  • Test command not found

Special Cases

No Tests Found

If no test framework detected:

{
  "passed": true,
  "framework": "none",
  "summary": "No test framework detected - skipping"
}

This counts as pass (can't fail tests that don't exist).

Tests Timeout

Set reasonable timeout (5 minutes default):

timeout 300 npm test 2>&1 | tee /tmp/test-output.txt

If timeout:

{
  "passed": false,
  "error": "Tests timed out after 300 seconds"
}

Flaky Tests

If tests fail intermittently, note in output but still fail:

{
  "passed": false,
  "note": "This test may be flaky - consider retry"
}

Example Usage

When invoked as /test-runner:

Running Test Runner checkpoint...

Detecting test framework...
Found package.json with "test" script using Jest.

Running: npm test
[test output streams...]

Parsing results...
Tests: 2 failed, 15 passed, 17 total

Failed tests:
1. UserService.login should validate credentials
   File: src/services/user.test.ts
   Error: Expected 200 but got 401

2. API.fetchData should handle timeout
   File: src/api/fetch.test.ts
   Error: Timeout exceeded

Result:
{
  "passed": false,
  "framework": "jest",
  "failed_tests": [...],
  "stats": {"total": 17, "passed": 15, "failed": 2}
}

Checkpoint result written to .checkpoints/test-runner.json

Framework-Specific Notes

Jest/Vitest

  • Use --json flag for machine-readable output if parsing is complex
  • npx jest --json --outputFile=/tmp/jest-results.json

Pytest

  • Use --tb=short for concise tracebacks
  • pytest --json-report --json-report-file=/tmp/pytest.json if plugin available

Cargo

  • cargo test -- --format=json for JSON output (nightly)
  • Standard output parsing works for stable

Go

  • go test -json ./... for JSON output
  • Parse per-line JSON for test events

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/12/2026

A comprehensive, multi-language test runner skill that automatically detects frameworks (Node, Python, Rust, Go), executes tests with timeouts, and produces structured JSON reports.

90
95
85
95
90

Metadata

Licenseunknown
Version-
Updated2/5/2026
Publishermajiayu000

Tags

apigithub-actionstesting