powergate: github.com/textileio/powergate/tests Index | Files | Directories

package tests

import "github.com/textileio/powergate/tests"

Index

Package Files

auth.go docker.go flaky.go ldevnet.go txmapds.go

func ClientConfigMA Uses

func ClientConfigMA(t *testing.T) (ma.Multiaddr, string)

ClientConfigMA returns the prepared multiaddress and Lotus token, to connect to a Lotus node.

func CreateLocalDevnet Uses

func CreateLocalDevnet(t TestingTWithCleanup, numMiners int) (lotus.ClientBuilder, address.Address, []address.Address)

CreateLocalDevnet returns an API client that targets a local devnet with numMiners number of miners. Refer to http://github.com/textileio/local-devnet for more information.

func CreateLocalDevnetWithIPFS Uses

func CreateLocalDevnetWithIPFS(t TestingTWithCleanup, numMiners int, ipfsMaddr string, mountVolumes bool) (lotus.ClientBuilder, address.Address, []address.Address)

CreateLocalDevnetWithIPFS creates a local devnet connected to an IPFS node.

func GetLotusToken Uses

func GetLotusToken(lotusFolderPath string) (string, error)

GetLotusToken returns the lotus token from a Lotus repo path.

func LaunchDevnetDocker Uses

func LaunchDevnetDocker(t TestingTWithCleanup, numMiners int, ipfsMaddr string, mountVolumes bool) *dockertest.Resource

LaunchDevnetDocker launches the devnet docker image.

func LaunchIPFSDocker Uses

func LaunchIPFSDocker(t require.TestingT) (*dockertest.Resource, func())

LaunchIPFSDocker runs a fresh go-ipfs docker image and returns the resource for container metadata.

func NewSimpleTx Uses

func NewSimpleTx(ds datastore.Datastore) datastore.Txn

NewSimpleTx creates a transaction.

func RunFlaky Uses

func RunFlaky(t *testing.T, f func(ft *FlakyT))

RunFlaky runs a flaky test with retries.

type FlakyT Uses

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

FlakyT provides retry mechanisms to test.

func NewFlakyT Uses

func NewFlakyT(t *testing.T) *FlakyT

NewFlakyT creates a new FlakyT.

func (*FlakyT) Cleanup Uses

func (ft *FlakyT) Cleanup(cls func())

Cleanup registers a cleanup function.

func (*FlakyT) Errorf Uses

func (ft *FlakyT) Errorf(format string, args ...interface{})

Errorf registers an error message.

func (*FlakyT) FailNow Uses

func (ft *FlakyT) FailNow()

FailNow indicates to fail the test.

type SimpleTx Uses

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

SimpleTx implements the transaction interface for datastores who do not have any sort of underlying transactional support.

func (*SimpleTx) Commit Uses

func (bt *SimpleTx) Commit() error

Commit confirms changes done in the transaction.

func (*SimpleTx) Delete Uses

func (bt *SimpleTx) Delete(key datastore.Key) error

Delete deletes a key.

func (*SimpleTx) Discard Uses

func (bt *SimpleTx) Discard()

Discard cancels the changes done in the transaction.

func (*SimpleTx) Get Uses

func (bt *SimpleTx) Get(k datastore.Key) ([]byte, error)

Get returns a key value within the transaction.

func (*SimpleTx) GetSize Uses

func (bt *SimpleTx) GetSize(k datastore.Key) (int, error)

GetSize returns the size of the key value.

func (*SimpleTx) Has Uses

func (bt *SimpleTx) Has(k datastore.Key) (bool, error)

Has returns true if the key exist, false otherwise.

func (*SimpleTx) Put Uses

func (bt *SimpleTx) Put(key datastore.Key, val []byte) error

Put sets the value for a key.

func (*SimpleTx) Query Uses

func (bt *SimpleTx) Query(q query.Query) (query.Results, error)

Query executes a query within the transaction scope.

type TestingTWithCleanup Uses

type TestingTWithCleanup interface {
    require.TestingT
    Cleanup(func())
}

TestingTWithCleanup is an augmented require.TestingT with a Cleanup function.

type TxMapDatastore Uses

type TxMapDatastore struct {
    *datastore.MapDatastore
    // contains filtered or unexported fields
}

TxMapDatastore is a in-memory datastore that satisfies TxnDatastore.

func NewTxMapDatastore Uses

func NewTxMapDatastore() *TxMapDatastore

NewTxMapDatastore returns a new TxMapDatastore.

func (*TxMapDatastore) Clone Uses

func (d *TxMapDatastore) Clone() (*TxMapDatastore, error)

Clone returns a cloned datastore.

func (*TxMapDatastore) Delete Uses

func (d *TxMapDatastore) Delete(key datastore.Key) error

Delete deletes a key.

func (*TxMapDatastore) Get Uses

func (d *TxMapDatastore) Get(key datastore.Key) ([]byte, error)

Get returns the value for a key.

func (*TxMapDatastore) NewTransaction Uses

func (d *TxMapDatastore) NewTransaction(readOnly bool) (datastore.Txn, error)

NewTransaction creates a transaction A read-only transaction should be indicated with readOnly equal true.

func (*TxMapDatastore) Put Uses

func (d *TxMapDatastore) Put(key datastore.Key, data []byte) error

Put sets the value of a key.

func (*TxMapDatastore) Query Uses

func (d *TxMapDatastore) Query(q query.Query) (query.Results, error)

Query executes a query in the datastore.

Directories

PathSynopsis
mocks

Package tests imports 20 packages (graph) and is imported by 2 packages. Updated 2020-09-21. Refresh now. Tools for package owners.