parallelsuite

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run[T testingSuite](t *testing.T, s T, args ...any)

Run discovers and runs all exported Test* methods on the given suite in parallel.

Each method gets its own fresh suite instance initialized for the subtest's *testing.T. Both the suite-level test and each method subtest are marked as parallel. Any sequential setup must happen before calling Run.

The suite must embed Suite and have no other fields.

Types

type Suite

type Suite[T testingSuite] struct {
	*require.Assertions
	protorequire.ProtoAssertions
	historyrequire.HistoryRequire
	// contains filtered or unexported fields
}

Suite provides parallel test execution with require-style (fail-fast) assertions.

It enforces a strict rule: a test method (or subtest) must either use assertions directly OR create subtests via Run — not both.

func (*Suite) Assert deprecated

func (b *Suite) Assert() *assert.Assertions

Deprecated: Assert returns non-fatal assertions which are not supported. Use s.NoError, s.Equal, etc. directly (require semantics).

func (*Suite) Require deprecated

func (b *Suite) Require() *require.Assertions

Deprecated: Require bypasses the guard mechanism. Use s.NoError, s.Equal, etc. directly.

func (*Suite[T]) Run

func (s *Suite[T]) Run(name string, fn func(T)) bool

Run creates a parallel subtest. The callback receives a fresh copy of the concrete suite type, initialized for the subtest's *testing.T.

func (*Suite) SetS deprecated

func (b *Suite) SetS(_ testifysuite.TestingSuite)

Deprecated: SetS is managed internally by Run. Do not call directly.

func (*Suite) SetT deprecated

func (b *Suite) SetT(_ *testing.T)

Deprecated: SetT is managed internally by Run. Do not call directly.

func (*Suite[T]) T

func (s *Suite[T]) T() *testing.T

T returns the *testing.T, panicking if the guard has been sealed.

Jump to

Keyboard shortcuts

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