testing

package
v0.0.0-...-0a271de Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 19 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeWithArgs

func InitializeWithArgs(c *gc.C, args InitializeArgs) *state.Controller

InitializeWithArgs initializes the state and returns it. If state was not already initialized, and args.Config is nil, the minimal default model configuration will be used.

func NewMongoInfo

func NewMongoInfo() *mongo.MongoInfo

NewMongoInfo returns information suitable for connecting to the testing controller's mongo database.

Types

type InitializeArgs

type InitializeArgs struct {
	Owner                     names.UserTag
	AdminPassword             string
	InitialConfig             *config.Config
	ControllerConfig          map[string]interface{}
	ControllerInheritedConfig map[string]interface{}
	ControllerModelType       state.ModelType
	RegionConfig              cloud.RegionConfig
	NewPolicy                 state.NewPolicyFunc
	Clock                     clock.Clock
}

type StateSuite

type StateSuite struct {
	mgotesting.MgoSuite
	testing.BaseSuite
	NewPolicy                 state.NewPolicyFunc
	Controller                *state.Controller
	StatePool                 *state.StatePool
	State                     *state.State
	Model                     *state.Model
	Owner                     names.UserTag
	AdminPassword             string
	Factory                   *factory.Factory
	InitialConfig             *config.Config
	ControllerConfig          map[string]interface{}
	ControllerInheritedConfig map[string]interface{}
	ControllerModelType       state.ModelType
	RegionConfig              cloud.RegionConfig
	Clock                     testclock.AdvanceableClock

	InstancePrechecker func(*gc.C, *state.State) environs.InstancePrechecker
	// contains filtered or unexported fields
}

StateSuite provides setup and teardown for tests that require a state.State.

func (*StateSuite) SetUpSuite

func (s *StateSuite) SetUpSuite(c *gc.C)

func (*StateSuite) SetUpTest

func (s *StateSuite) SetUpTest(c *gc.C)

func (*StateSuite) TearDownSuite

func (s *StateSuite) TearDownSuite(c *gc.C)

func (*StateSuite) TearDownTest

func (s *StateSuite) TearDownTest(c *gc.C)

func (*StateSuite) WaitForModelWatchersIdle

func (s *StateSuite) WaitForModelWatchersIdle(c *gc.C, modelUUID string)

WaitForModelWatchersIdle firstly waits for the txn poller to process all pending changes, then waits for the hub watcher on the state object to have finished processing all those events.

Jump to

Keyboard shortcuts

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