Documentation ¶
Index ¶
- Constants
- Variables
- type ImageConfig
- type Manager
- func (m *Manager) ClearResources() error
- func (m *Manager) ExecCmd(t *testing.T, containerName string, command []string, success string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecHermesCmd(t *testing.T, command []string, success string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecTxCmd(t *testing.T, chainId string, containerName string, command []string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecTxCmdWithSuccessString(t *testing.T, chainId string, containerName string, command []string, ...) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) GetHostPort(containerName string, portId string) (string, error)
- func (m *Manager) GetNodeResource(containerName string) (*dockertest.Resource, error)
- func (m *Manager) PurgeResource(resource *dockertest.Resource) error
- func (m *Manager) RemoveNodeResource(containerName string) error
- func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod, chainExpeditedVotingPeriod int, ...) (*dockertest.Resource, error)
- func (m *Manager) RunHermesResource(chainAID, osmoARelayerNodeName, osmoAValMnemonic, chainBID, ... string, ...) (*dockertest.Resource, error)
- func (m *Manager) RunNodeResource(chainId string, containerName, valCondifDir string) (*dockertest.Resource, error)
Constants ¶
const ( // Current Git branch osmosis repo/version. It is meant to be built locally. // It is used when skipping upgrade by setting OSMOSIS_E2E_SKIP_UPGRADE to true). // This image should be pre-built with `make docker-build-debug` either in CI or locally. CurrentBranchOsmoRepository = "osmosis" CurrentBranchOsmoTag = "debug" )
const (
GasLimit = 400000
)
Variables ¶
var ( // We set consensus min fee = .0025 uosmo / gas * 400000 gas = 1000 Fees = txfeestypes.ConsensusMinFee.Mul(osmomath.NewDec(GasLimit)).Ceil().TruncateInt64() )
Functions ¶
This section is empty.
Types ¶
type ImageConfig ¶
type ImageConfig struct { InitRepository string InitTag string OsmosisRepository string OsmosisTag string RelayerRepository string RelayerTag string }
ImageConfig contains all images and their respective tags needed for running e2e tests.
func NewImageConfig ¶
func NewImageConfig(isUpgrade, isFork bool) ImageConfig
Returns ImageConfig needed for running e2e test. If isUpgrade is true, returns images for running the upgrade If isFork is true, utilizes provided fork height to initiate fork logic
type Manager ¶
type Manager struct { ImageConfig // contains filtered or unexported fields }
Manager is a wrapper around all Docker instances, and the Docker API. It provides utilities to run and interact with all Docker containers used within e2e testing.
func NewManager ¶
NewManager creates a new Manager instance and initializes all Docker specific utilies. Returns an error if initialiation fails.
func (*Manager) ClearResources ¶
ClearResources removes all outstanding Docker resources created by the Manager.
func (*Manager) ExecCmd ¶
func (m *Manager) ExecCmd(t *testing.T, containerName string, command []string, success string) (bytes.Buffer, bytes.Buffer, error)
ExecCmd executes command by running it on the node container (specified by containerName) success is the output of the command that needs to be observed for the command to be deemed successful. It is found by checking if stdout or stderr contains the success string anywhere within it. returns container std out, container std err, and error if any. An error is returned if the command fails to execute or if the success string is not found in the output.
func (*Manager) ExecHermesCmd ¶
func (m *Manager) ExecHermesCmd(t *testing.T, command []string, success string) (bytes.Buffer, bytes.Buffer, error)
ExecHermesCmd executes command on the hermes relaer container.
func (*Manager) ExecTxCmd ¶
func (m *Manager) ExecTxCmd(t *testing.T, chainId string, containerName string, command []string) (bytes.Buffer, bytes.Buffer, error)
ExecTxCmd Runs ExecTxCmdWithSuccessString searching for `code: 0`
func (*Manager) ExecTxCmdWithSuccessString ¶
func (m *Manager) ExecTxCmdWithSuccessString(t *testing.T, chainId string, containerName string, command []string, successStr string) (bytes.Buffer, bytes.Buffer, error)
ExecTxCmdWithSuccessString Runs ExecCmd, with flags for txs added. namely adding flags `--chain-id={chain-id} -b=block --yes --keyring-backend=test "--log_format=json" --gas=400000`, and searching for `successStr`
func (*Manager) GetHostPort ¶
GetHostPort returns the port-forwarding address of the running host necessary to connect to the portId exposed inside the container. The container is determined by containerName. Returns the host-port or error if any.
func (*Manager) GetNodeResource ¶
GetNodeResource returns the node resource for containerName.
func (*Manager) PurgeResource ¶
PurgeResource purges the container resource and returns an error if any.
func (*Manager) RemoveNodeResource ¶
RemoveNodeResource removes a node container specified by containerName. Returns error if any.
func (*Manager) RunChainInitResource ¶
func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod, chainExpeditedVotingPeriod int, validatorConfigBytes []byte, mountDir string, forkHeight int) (*dockertest.Resource, error)
RunChainInitResource runs a chain init container to initialize genesis and configs for a chain with chainId. The chain is to be configured with chainVotingPeriod and validators deserialized from validatorConfigBytes. The genesis and configs are to be mounted on the init container as volume on mountDir path. Returns the container resource and error if any. This method does not Purge the container. The caller must deal with removing the resource.
func (*Manager) RunHermesResource ¶
func (m *Manager) RunHermesResource(chainAID, osmoARelayerNodeName, osmoAValMnemonic, chainBID, osmoBRelayerNodeName, osmoBValMnemonic string, hermesCfgPath string) (*dockertest.Resource, error)
RunHermesResource runs a Hermes container. Returns the container resource and error if any. the name of the hermes container is "<chain A id>-<chain B id>-relayer"
func (*Manager) RunNodeResource ¶
func (m *Manager) RunNodeResource(chainId string, containerName, valCondifDir string) (*dockertest.Resource, error)
RunNodeResource runs a node container. Assings containerName to the container. Mounts the container on valConfigDir volume on the running host. Returns the container resource and error if any.