conformance

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package conformance provides the shared behavioral test suite that verifies any currus.Engine implementation against the neutral contract defined by the currus package.

The suite is the executable specification of the neutral contract. The same tests run against:

  • The [currustest] in-memory fake (unit layer, always on, no daemon).
  • Real engine daemons (integration layer, gated by //go:build integration and CURRUS_TEST_ENGINE=docker|podman|containerd).

Driver maintainers call Run with a factory function that returns an currus.Engine for each sub-test. Engines that implement optional capability interfaces (currus.Logger, currus.Execer, currus.Inspector, currus.Stater, currus.Waiter, currus.Eventer) are tested for those as well.

Usage (unit layer, no daemon):

func TestConformance(t *testing.T) {
    conformance.Run(t, func(t *testing.T) currus.Engine {
        return currustest.New()
    })
}

Usage (integration layer):

//go:build integration

func TestConformanceIntegration(t *testing.T) {
    conformance.Run(t, func(t *testing.T) currus.Engine {
        eng, err := currus.New(context.Background())
        if err != nil {
            t.Skip("no reachable engine:", err)
        }
        t.Cleanup(func() { _ = eng.Close() })
        return eng
    })
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, newEngine func(t *testing.T) currus.Engine)

Run runs the full conformance suite against the engine returned by newEngine. newEngine is called once per sub-test. If the engine needs cleanup, register it with t.Cleanup inside newEngine.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL