Skip to content

Releases: zerosixty/samurai

v0.8.3 — Skill v3 cleanup

27 Apr 10:59
16ac1f7

Choose a tag to compare

Skill tooling cleanup for the Claude Code samurai skill (no framework code changes).

Changes

  • claude-setup version sync: bumped the version constant from "2" to "3" so claude-setup correctly upgrades v2 installs to the v3 SKILL.md already shipped in v0.8.2
  • Dropped false-positive rule #5 ("Existing isolation: test already uses Ginkgo BeforeEach or similar") — too broad, the other four rules already cover the real cases

Full Changelog: v0.8.2...v0.8.3

v0.8.2 — Factory: extract when shared across Tests

24 Apr 12:09
7acd7ff

Choose a tag to compare

Skill documentation refinement for the Claude Code samurai skill (no framework code changes).

Change

Relaxed the strict "always inline the factory closure" rule:

  • Prefer inlining the factory inside `RunWith`
  • Extract to a private helper (below the Tests) when 2+ Test functions in the same file need identical factory logic — duplication outweighs locality once there is no single caller

Why

Multi-Test files (e.g. 5 `TestXxx` sharing one factory) turned strict inlining into mandatory 5× duplication. The locality rationale only applies when there is a single caller.

Full Changelog: v0.8.1...v0.8.2

v0.8.1 — Skill detection protocol

24 Apr 11:13
dbd8a76

Choose a tag to compare

Skill documentation refinements for the Claude Code samurai skill (no framework code changes).

Changes

  • File layout guide: context type + Test on top, helpers below
  • Detection protocol: read bodies not names, swap-order test, find the writes
  • Refined false-positive rules: read-only chains and shared setup helpers are not samurai candidates

Full Changelog: v0.8.0...v0.8.1

v0.8.0 — Auto-parallel top-level tests

23 Apr 18:58
0597aa8

Choose a tag to compare

Breaking: top-level `TestXxx` is now parallel by default

`samurai.Run` / `samurai.RunWith` now call `t.Parallel()` on the top-level `*testing.T`, not just on samurai-emitted sub-tests. Tests in the same Go package run concurrently without a manual `t.Parallel()` at the top of every `TestXxx`.

Migration

  • Remove any manual `t.Parallel()` from the first line of a `TestXxx` that uses `samurai.Run` / `samurai.RunWith`. Go panics with `t.Parallel called multiple times` if the same `*testing.T` is marked parallel twice.
  • Pass `samurai.Sequential()` for any test that uses `t.Setenv`, binds a fixed port, or otherwise cannot tolerate sibling tests running alongside it.

Why

Previously only sub-tests within a single `TestXxx` ran in parallel; different `TestXxx` functions in the same package ran serially unless each one wrote `t.Parallel()` manually. Real-world adoption (20 samurai tests in one package, ~140 leaves) dropped from ~30s to ~19s wall-clock once top-level parallelism was enabled — this release makes that the default.

🤖 Generated with Claude Code

v0.7.2

31 Mar 10:50
40297ee

Choose a tag to compare

Skill improvements

  • Split Claude Code skill into 3 files: SKILL.md (rules + when to use), api.md (examples), pitfalls.md (validation + wrong patterns)
  • Added "When to Use" decision guide with clear criteria for when samurai is/isn't appropriate
  • Bumped skill version to v2 — run go run github.com/zerosixty/samurai/cmd/claude-setup@latest to update

v0.7.1

28 Mar 14:22
c972406

Choose a tag to compare

Documentation

  • Add best practice: one action + its assertions = one Test() — don't split assertions into child Tests
  • Add Wrong Pattern #6 to Claude Code skill showing the antipattern with fix
  • Update all examples across skill, CLAUDE.md, and README.md to follow the pattern

v0.7.0

03 Mar 10:43
8dda783

Choose a tag to compare

Factory per path (breaking behavior change)

The factory in RunWith is now called once per test path instead of once per scope level. The same value is reused across all scope levels in a path, so parent state is visible to children.

Breaking change

Code that relied on getting a fresh factory-created value at each scope level will now receive the same value throughout the path. This is the intended behavior — it enables sharing state (e.g., database connections, assertion helpers) set up in parent callbacks with child callbacks.

Cleanup ordering

  • Inner cleanups run before outer cleanups (unchanged)
  • Factory cleanups now run last, after all callback cleanups

v0.6.0

03 Mar 08:35
70bb74f

Choose a tag to compare

What's New

  • BaseContext.Context() — New method that returns the scope's context.Context, enabling RunWith factories to perform initialization that requires a context (e.g., connecting to databases, setting up providers). Delegates to testing.T.Context().

Example

samurai.RunWith(t, func(w samurai.W) *MyCtx {
    ctx := w.Context()
    return &MyCtx{BaseContext: w, db: connectDB(ctx)}
}, builder)

Full Changelog: v0.5.0...v0.6.0

v0.5.0

02 Mar 16:12
cd435b9

Choose a tag to compare

Claude Code Skill Installer

Samurai now ships a zero-install CLI that sets up Claude Code context for your project:

go run github.com/zerosixty/samurai/cmd/claude-setup@latest

This creates .claude/skills/samurai/SKILL.md — a compact, AI-optimized reference (~1000 tokens) that teaches Claude Code how to write samurai tests correctly: variable scoping, cleanup patterns, Skip(), RunWith, and all validation rules.

Run it once per project. It's idempotent and auto-updates when a new skill version is available.

What's new

  • Claude Code skill installer (cmd/claude-setup) — one command to teach Claude Code the samurai API
  • GoLand plugin publish workflow — automated plugin builds via GitHub Actions
  • Updated README — new banner, merged Quick Start, GoLand screenshots, AI-assisted development section
  • New ExampleRun_skip — testable example demonstrating s.Skip() behavior
  • Docs cleanup — removed stale architecture docs, updated plugin docs

Full changelog

v0.4.0...v0.5.0

v0.4.0

27 Feb 09:50

Choose a tag to compare