parallel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

🤹 Parallel

Testo plugin for making all tests parallel by default.

Go has great support for parallel tests. But marking a test as parallel requires an explicit t.Parallel() call. This plugin does that for you!

Quick Start

go get github.com/ozontech/testo-toppings

Add it to your T:

package main

import (
	"github.com/ozontech/testo"
	"github.com/ozontech/testo-toppings/parallel"
)

type T struct {
	*testo.T
	*parallel.PluginParallel
}

All your tests are now parallel by default!

[!NOTE] With this plugin enabled, explicit calls to t.Parallel() are no-op.

Use annotations to mark any test as synchronous:

var _ = testo.For(Suite.TestFoo, parallel.WithSync())

func (Suite) TestFoo(t T) {
    // ...
}

To make all tests synchronous pass -parallel.sync flag to go test:

go test ./... -parallel.sync

Documentation

Overview

Package parallel provides plugin to mark tests as parallel by default.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSync

func WithSync() testoplugin.Option

WithSync signals that this test is to be run in sync with (and only with) other sync tests.

Types

type PluginParallel

type PluginParallel struct {
	*testo.T
	// contains filtered or unexported fields
}

PluginParallel marks all tests as parallel by default.

func (*PluginParallel) Plugin

Plugin implements testoplugin.Plugin.

Jump to

Keyboard shortcuts

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