# Test Runner

> Run Go and frontend tests for kattle project. Use after code changes to verify correctness. Use when this capability is needed.

- Skill: `tomevault-io/test-runner-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/test-runner-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/test-runner-4/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/test-runner-4

---


# Test Runner Skill

This skill provides commands and workflows for running tests in the kattle project across Go backend and React frontend codebases.

## Go Tests

Run backend tests using the Go test runner:

```bash
# All tests
go test ./...

# Specific package
go test ./internal/kube/...

# With verbose output
go test -v ./...

# With race detection
go test -race ./...

# With coverage
go test -cover ./...
```

### Options Reference
- `-v`: Verbose output with individual test results
- `-race`: Enable race condition detection
- `-cover`: Display coverage percentage
- `-timeout`: Set timeout (e.g., `-timeout 30s`)
- `-run`: Run specific tests matching pattern (e.g., `-run TestName`)

## Frontend Tests

Run frontend tests using npm in the React project:

```bash
# Run all tests (single run)
npm --prefix cmd/gui/frontend run test:run

# Watch mode (re-run on file changes)
npm --prefix cmd/gui/frontend run test

# With coverage report
npm --prefix cmd/gui/frontend run test:run -- --coverage
```

### Frontend Test Scripts
- `test`: Run tests in watch mode for development
- `test:run`: Single test run (useful for CI/CD)
- Coverage reports are generated in `coverage/` directory

## Combined Test Run

Run both Go and frontend tests in sequence:

```bash
# Quick validation (both suites)
go test ./... && npm --prefix cmd/gui/frontend run test:run
```

This validates the entire codebase before committing or creating a PR.

## Report Format

After running tests, expect output with:

- **PASS/FAIL status**: Clear indication of test suite success or failure
- **Failed test details**: Names and error messages for any failing tests
- **Coverage summary**: If coverage flags are used, percentage of code covered
- **Execution time**: Total time taken to run test suite

## Recommended Test Workflow

1. **After making changes**: Run targeted tests first
   ```bash
   go test ./internal/kube/...
   ```

2. **Before committing**: Run full test suites
   ```bash
   go test ./... && npm --prefix cmd/gui/frontend run test:run
   ```

3. **For pull requests**: Include coverage results
   ```bash
   go test -cover ./... 
   npm --prefix cmd/gui/frontend run test:run -- --coverage
   ```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/flavono123) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-12 -->

