integration

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 25 Imported by: 9

Documentation

Index

Constants

View Source
const (
	PortsPerSuite = 10 * portsPerNode
)

Variables

View Source
var NoReplication = &ReplicationOptions{}

Functions

func ReplaceTemplate added in v0.4.0

func ReplaceTemplate(topologies []api.Topology) []api.Topology

Types

type Configuration

type Configuration struct {
	StartPort int
}

type Infrastructure

type Infrastructure struct {
	TestDir           string
	StartPort         int
	Ctx               *context.Context
	NWO               *nwo.NWO
	BuildServer       *common.BuildServer
	DeleteOnStop      bool
	DeleteOnStart     bool
	PlatformFactories map[string]api.PlatformFactory
	Topologies        []api.Topology
	FscPlatform       *fsc.Platform
}

func Clients

func Clients(dir string, topologies ...api.Topology) (*Infrastructure, error)

Clients instantiate a new test integration infrastructure to access view client and CLI

func Generate

func Generate(startPort int, race bool, topologies ...api.Topology) (*Infrastructure, error)

func GenerateAt

func GenerateAt(startPort int, path string, race bool, topologies ...api.Topology) (*Infrastructure, error)

func Load

func Load(startPort int, dir string, race bool, topologies ...api.Topology) (*Infrastructure, error)

func New

func New(startPort int, path string, topologies ...api.Topology) (*Infrastructure, error)

func (*Infrastructure) CLI

func (i *Infrastructure) CLI(name string) api.ViewClient

func (*Infrastructure) Client

func (i *Infrastructure) Client(name string) api.GRPCClient

func (*Infrastructure) EnableRaceDetector

func (i *Infrastructure) EnableRaceDetector()

func (*Infrastructure) Generate

func (i *Infrastructure) Generate()

func (*Infrastructure) Identity

func (i *Infrastructure) Identity(name string) view.Identity

func (*Infrastructure) InitClients

func (i *Infrastructure) InitClients()

func (*Infrastructure) Load

func (i *Infrastructure) Load()

func (*Infrastructure) RegisterPlatformFactory

func (i *Infrastructure) RegisterPlatformFactory(factory api.PlatformFactory)

func (*Infrastructure) Serve

func (i *Infrastructure) Serve() error

func (*Infrastructure) Start

func (i *Infrastructure) Start()

func (*Infrastructure) StartFSCNode

func (i *Infrastructure) StartFSCNode(id string)

func (*Infrastructure) Stop

func (i *Infrastructure) Stop()

func (*Infrastructure) StopFSCNode

func (i *Infrastructure) StopFSCNode(id string)

func (*Infrastructure) ViewCmd

func (i *Infrastructure) ViewCmd(node *smartclient.Replica) commands.View

func (*Infrastructure) WebClient added in v0.3.0

func (i *Infrastructure) WebClient(name string) api.WebClient

type ReplicationOptions added in v0.4.0

type ReplicationOptions struct {
	ReplicationFactors map[string]int
	SQLConfigs         map[string]*postgres.ContainerConfig
}

func (*ReplicationOptions) For added in v0.4.0

func (o *ReplicationOptions) For(name string) []node.Option

type TestPortRange

type TestPortRange int

TestPortRange represents a port range

const (
	BasePort TestPortRange = basePort + PortsPerSuite*iota
	PingPongPort
	PingPong2Port
	PingPongWithAdminPort
	IOUPort
	IOUHSMPort
	IOUWithOrionBackendPort
	AssetTransferSecuredAgreementWithChaincode
	AssetTransferSecuredAgreementWithApprovers
	AssetTransferEventsAgreementWithChaincode
	TwoFabricNetworksPort
	TwoFabricNetworksWithWeaverRelayPort
	FabricStopRestart
	PingPongOrion
)

func (TestPortRange) StartPortForNode

func (t TestPortRange) StartPortForNode() int

StartPortForNode On linux, the default ephemeral port range is 32768-60999 and can be allocated by the system for the client side of TCP connections or when programs explicitly request one. Given linux is our default CI system, we want to try avoid ports in that range.

type TestSuite added in v0.4.0

type TestSuite struct {
	II *Infrastructure
	// contains filtered or unexported fields
}

func NewTestSuite added in v0.4.0

func NewTestSuite(generator func() (*Infrastructure, error)) *TestSuite

func NewTestSuiteWithSQL added in v0.4.0

func NewTestSuiteWithSQL(sqlConfigs map[string]*postgres.ContainerConfig, generator func() (*Infrastructure, error)) *TestSuite

func (*TestSuite) Setup added in v0.4.0

func (s *TestSuite) Setup()

func (*TestSuite) TearDown added in v0.4.0

func (s *TestSuite) TearDown()

Jump to

Keyboard shortcuts

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