annotation

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package annotation provides utilities for parsing and managing test annotations that categorize e2e tests as parallel or serial execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPattern

func FilterPattern(tests []TestInfo) string

FilterPattern creates a regex pattern to match only the specified tests

Types

type ScanOptions

type ScanOptions struct {
	RequireAnnotations bool // If true, fail on unannotated tests
	RequireReason      bool // If true, fail on serial tests without reason
}

ScanOptions configures the behavior of test annotation scanning

func DefaultScanOptions

func DefaultScanOptions() ScanOptions

DefaultScanOptions returns the default scanning options

type TestInfo

type TestInfo struct {
	Name      string
	File      string
	Line      int
	Execution string // "parallel" or "serial"
	Reason    string // Required for serial tests
}

TestInfo represents metadata about a test function

type TestManifest

type TestManifest struct {
	Parallel []TestInfo
	Serial   []TestInfo
}

TestManifest holds categorized tests

func ScanTestAnnotations

func ScanTestAnnotations(dir string, opts ScanOptions) (*TestManifest, error)

ScanTestAnnotations parses all *_test.go files in a directory and extracts test metadata. It enforces annotation requirements based on the provided options.

Jump to

Keyboard shortcuts

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