integration

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package integration provides comprehensive integration tests for the GoPCA monorepo. These tests validate end-to-end workflows, cross-application communication, and ensure all components work together correctly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContains

func AssertContains(t *testing.T, str, substr, msg string)

AssertContains checks if string contains substring

func AssertError

func AssertError(t *testing.T, err error, msg string)

AssertError fails test if error is nil

func AssertNoError

func AssertNoError(t *testing.T, err error, msg string)

AssertNoError fails test if error is not nil

func CheckFileExists

func CheckFileExists(t *testing.T, path string)

CheckFileExists verifies a file exists and is non-empty

func CompareMatrices

func CompareMatrices(a, b [][]float64, tolerance float64) error

CompareMatrices compares two matrices within tolerance

func CompareVectors

func CompareVectors(a, b []float64, tolerance float64) error

CompareVectors compares two vectors within tolerance

func ExtractJSONFromOutput

func ExtractJSONFromOutput(output string) (map[string]interface{}, error)

ExtractJSONFromOutput extracts JSON from mixed CLI output

func GenerateTestMatrix

func GenerateTestMatrix(rows, cols int, seed float64) [][]string

GenerateTestMatrix creates a deterministic test matrix

func ParseCSVOutput

func ParseCSVOutput(output string) ([][]string, error)

ParseCSVOutput parses CSV output from CLI

func RequirePlatform

func RequirePlatform(t *testing.T, platform string)

RequirePlatform skips test unless on specific platform

func SkipIfShort

func SkipIfShort(t *testing.T)

SkipIfShort skips test if running in short mode

func SkipOnPlatform

func SkipOnPlatform(t *testing.T, platforms ...string)

SkipOnPlatform skips test on specific platforms

Types

type BenchmarkResult

type BenchmarkResult struct {
	Duration time.Duration
	MemUsed  uint64
	CPUUsage float64
}

Benchmark helpers

type SampleDataset

type SampleDataset struct {
	Name       string
	Path       string
	Rows       int
	Cols       int
	HasMissing bool
	HasGroups  bool
	HasTargets bool
}

CreateSampleDataset creates a standard test dataset

type TestConfig

type TestConfig struct {
	TempDir      string
	CLIPath      string
	Timeout      time.Duration
	Verbose      bool
	SkipSlow     bool
	TestDataPath string
}

TestConfig holds configuration for integration tests

func NewTestConfig

func NewTestConfig(t *testing.T) *TestConfig

NewTestConfig creates a test configuration

func (*TestConfig) BenchmarkCLI

func (tc *TestConfig) BenchmarkCLI(t *testing.T, args ...string) *BenchmarkResult

func (*TestConfig) BuildCLI

func (tc *TestConfig) BuildCLI(t *testing.T)

BuildCLI builds the pca CLI for testing

func (*TestConfig) CreateSampleDatasets

func (tc *TestConfig) CreateSampleDatasets(t *testing.T) map[string]*SampleDataset

func (*TestConfig) CreateTestCSV

func (tc *TestConfig) CreateTestCSV(t *testing.T, name string, data [][]string) string

CreateTestCSV creates a CSV file with test data

func (*TestConfig) LoadJSONResult

func (tc *TestConfig) LoadJSONResult(t *testing.T, path string) map[string]interface{}

LoadJSONResult loads and parses a JSON result file

func (*TestConfig) RunCLI

func (tc *TestConfig) RunCLI(t *testing.T, args ...string) (string, error)

RunCLI executes the CLI with given arguments

Jump to

Keyboard shortcuts

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