Awesome Go

axiom

CategoryTesting
SubcategoryTesting Frameworks
Stars32

Composable Go test framework with fixtures, hooks, retries, metadata, plugins, and parallel execution

About axiom

Axiom

πŸš€ Modern, extensible, and composable Go test framework.

CI Go Reference codecov Mentioned in Awesome Go License GitHub stars

Made with ❀️ by @NikitaFilonov


πŸ“‘ Table of Contents


✨ About

Axiom is a modern testing framework for Go, built around extensibility, composition, and a clean, powerful runtime execution model. It enhances Go’s standard testing package with capabilities normally found in mature ecosystems like pytest, JUnit5, and allure frameworks β€” without hiding or replacing Go’s native tooling.

Axiom provides:

  • Composable test configuration β€” merge global & local config seamlessly (Runner ↔ Case).
  • Powerful runtime engine β€” deterministic lifecycle, step execution, subtests, and retries.
  • Hooks system β€” before/after runner, test attempt, and step execution.
  • Plugins API β€” extend framework behavior without touching the core.
  • Fixtures β€” lazy dependencies scoped to one test attempt, with automatic cleanup.
  • Metadata system β€” tags, severity, labels, epics, features, stories.
  • Parallelization control β€” opt-in at both runner & case granularity.

Axiom is not a DSL replacement β€” it’s a composable execution engine that sits on top of Go’s native testing stack and supercharges it.


πŸ“¦ Installation

Requires Go 1.26 or newer.

go get github.com/Nikita-Filonov/axiom

πŸš€ Quick Start

This example shows the smallest useful Axiom flow: define a runner, describe a case, and execute steps inside standard go test.

package example_test

import (
	"testing"

	"github.com/Nikita-Filonov/axiom"
)

func TestUserLogin(t *testing.T) {
	runner := axiom.NewRunner()

	c := axiom.NewCase(
		axiom.WithCaseName("user can login"),
	)

	runner.RunCase(t, c, func(cfg *axiom.Config) {
		var token string

		cfg.Step("submit credentials", func() {
			token = "access-token"
		})

		cfg.Step("check login result", func() {
			if token == "" {
				t.Fatal("expected access token")
			}
		})
	})
}

For a full project layout with shared runners, fixtures, metadata, and domain-specific test organization, see ./docs/usage.


❓ Why Axiom?

Go’s built-in testing package is intentionally minimal. This philosophy makes tests simple, fast, and approachable β€” but it also leaves developers on their own when building large, structured, and maintainable test suites.

When a project grows, you quickly run into hard limitations:

  • no fixtures or resource lifecycle management
  • no before/after hooks
  • no retry mechanism for flaky operations
  • no metadata (tags, severity, labels, layers, epics)
  • no step model for readable reporting
  • no plugin or extension architecture
  • no way to compose configuration (global ↔ per-test)
  • limited reporting capabilities
  • and no clear path to build these features on top

Most teams end up reinventing these tools internally β€” often in incompatible ways.

Axiom solves these real-world problems.

Instead of replacing Go’s testing ecosystem, Axiom extends it with a powerful execution engine:

  • Fixtures β€” lazy-evaluated, cached resources with automatic cleanup
  • Hooks β€” before/after runner, test attempt, and step
  • Retries β€” isolated repeat attempts with configurable delay
  • Metadata β€” tags, severity, labels, epics, features, stories
  • Step model β€” structured execution with reporting support
  • Plugins β€” clean extension mechanism for integrating tooling (Allure, metrics, filtering, etc.)
  • Composable configuration β€” merge global runner settings with per-test overrides
  • Parallelization control β€” opt-in, explicit, predictable

Axiom preserves the core spirit of Go β€” clarity, composability, explicit behavior β€” while adding the missing building blocks needed for serious test engineering.

It’s not a DSL replacement. It’s not a β€œmagic” wrapper.

Axiom is a test runtime engine that unlocks capabilities traditionally found in frameworks like pytest, JUnit5, and Allure, but implemented the Go way: simple, explicit, and pragmatic.


πŸ§ͺ IDE Support

GoLand / IntelliJ IDEA Ultimate β€” install the official Axiom Test Runner plugin (source) from JetBrains Marketplace to get:

  • 🟒 Green gutter icon on every TestXxx method of an Axiom suite.
  • ▢️ Full native menu β€” Run, Debug, Run with Coverage, Profile (CPU/Memory/Blocking).
  • 🌳 Results in the standard Test Results tool window.
  • ⚑ Zero configuration β€” works with any struct passed to axiom.NewSuite or axiom.NewSuiteFactory, regardless of what it embeds.
# Or install directly from the IDE:
#   Settings β†’ Plugins β†’ Marketplace β†’ search "Axiom Test Runner"

πŸ“˜ Documentation

Axiom includes structured, minimal, and maintainable documentation for every core concept of the framework. See the following folders:

  • ./docs/usage β€” realistic end-to-end example of building a test framework with Axiom
  • ./docs/philosophy β€” design principles and how Axiom fits into the Go testing ecosystem
  • ./docs/runner β€” global execution environment, plugins, hooks, fixture definitions, retries
  • ./docs/suite β€” optional execution boundary for grouped tests, shared runners, resources, and lifecycle
  • ./docs/package β€” TestMain lifecycle boundary for runners shared across many top-level TestXxx functions
  • ./docs/case β€” declarative test definitions, metadata, parameters, per-test configuration
  • ./docs/config β€” merged runtime state for each test attempt (steps, wraps, hooks, fixtures, metadata)
  • ./docs/local β€” per-attempt typed local state stored on Config
  • ./docs/cache β€” standalone concurrent typed cache with coordinated creation and explicit ownership
  • ./docs/toolset β€” typed helper bundles built into Local and consumed as cfg.Tools
  • ./docs/runtime β€” execution runtime: wraps, logs, artefacts, sinks
  • ./docs/events β€” raw execution events for lifecycle and emitted facts
  • ./docs/fixture β€” lazy resource lifecycle, fixture dependencies, automatic cleanup, typed keys and definitions
  • ./docs/resource β€” runner-scoped shared resources, lifecycle, concurrency, deterministic teardown, typed keys
  • ./docs/meta β€” metadata: tags, labels, severity, epics, features, stories, layers
  • ./docs/log β€” structured logging via Runtime log sinks
  • ./docs/assert β€” structured assertion events and runtime assert sinks
  • ./docs/artefacts β€” binary and structured test outputs
  • ./docs/parallel β€” parallel execution flags and merging behavior
  • ./docs/retry β€” retry policies, isolated attempts, override rules
  • ./docs/skip β€” static & dynamic skip rules with reasons
  • ./docs/hooks β€” lifecycle hooks for tests, steps, and subtests
  • ./docs/params β€” typed parameter injection for test cases
  • ./docs/context β€” structured global and per-test context values
  • ./docs/plugins β€” plugin system and guidelines for writing custom plugins
  • ./docs/glossary β€” definitions of all core Axiom concepts

Frequently Asked Questions

What is axiom?

axiom is a Testing library for the Go programming language. Composable Go test framework with fixtures, hooks, retries, metadata, plugins, and parallel execution

How do I install axiom?

Install axiom with the Go module system using `go get Nikita-Filonov/axiom`. Check the repository for the current installation instructions.

What category does axiom belong to?

axiom is listed under Testing, specifically Testing Frameworks.

← Back to Testing Frameworks