contract

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package contract provides contract test assertions for Roady syncer plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractSuite

type ContractSuite struct {
	// contains filtered or unexported fields
}

ContractSuite runs all contract assertions against a plugin binary.

func NewContractSuite

func NewContractSuite() *ContractSuite

NewContractSuite creates a new contract suite.

func (*ContractSuite) RunBinary

func (s *ContractSuite) RunBinary(path string) (*SuiteResult, error)

RunBinary loads a plugin binary and runs the full contract suite.

func (*ContractSuite) RunWithSyncer

func (s *ContractSuite) RunWithSyncer(syncer domainPlugin.Syncer) *SuiteResult

RunWithSyncer runs the contract suite against an already-loaded syncer instance.

type Result

type Result struct {
	Name    string
	Passed  bool
	Message string
}

Result captures the outcome of a single contract assertion.

func AssertInitSuccess

func AssertInitSuccess(syncer domainPlugin.Syncer) Result

AssertInitSuccess verifies that Init succeeds with valid config.

func AssertInitWithBadConfig

func AssertInitWithBadConfig(syncer domainPlugin.Syncer) Result

AssertInitWithBadConfig verifies that Init returns an error for bad config.

func AssertPushInvalidTask

func AssertPushInvalidTask(syncer domainPlugin.Syncer) Result

AssertPushInvalidTask verifies Push handles an empty task ID gracefully.

func AssertPushValidTask

func AssertPushValidTask(syncer domainPlugin.Syncer) Result

AssertPushValidTask verifies Push accepts a valid task transition.

func AssertSyncEmptyPlan

func AssertSyncEmptyPlan(syncer domainPlugin.Syncer) Result

AssertSyncEmptyPlan verifies Sync handles an empty plan without error.

func AssertSyncWithTasks

func AssertSyncWithTasks(syncer domainPlugin.Syncer) Result

AssertSyncWithTasks verifies Sync processes tasks and returns status updates.

type SuiteResult

type SuiteResult struct {
	Results []Result
	Passed  int
	Failed  int
}

SuiteResult aggregates results from running the full contract suite.

Jump to

Keyboard shortcuts

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