Documentation ¶
Index ¶
- func CreateTestClient(t testing.TB, url string) *httpexpect.Expect
- func DisableManager(inst *instance.Instance, shouldRemoveUUID bool) error
- func NeedCouchdb(t *testing.T)
- func TODO(t *testing.T, date string, args ...interface{})
- func WithFlag(t *testing.T, inst *instance.Instance, name string, value interface{})
- func WithManager(t *testing.T, inst *instance.Instance, managerConfig ManagerConfig) (shouldRemoveUUID bool)
- type ManagerConfig
- type TestSetup
- func (c *TestSetup) GetTestAdminClient() (*oauth.Client, string)
- func (c *TestSetup) GetTestClient(scopes string) (*oauth.Client, string)
- func (c *TestSetup) GetTestInstance(opts ...*lifecycle.Options) *instance.Instance
- func (c *TestSetup) GetTestServer(prefix string, routes func(*echo.Group), mws ...func(*echo.Echo) *echo.Echo) *httptest.Server
- func (c *TestSetup) GetTestServerMultipleRoutes(mpr map[string]func(*echo.Group), mws ...func(*echo.Echo) *echo.Echo) *httptest.Server
- func (c *TestSetup) InstallMiniApp() (string, error)
- func (c *TestSetup) InstallMiniClientSideKonnector() (string, error)
- func (c *TestSetup) InstallMiniKonnector() (string, error)
- func (c *TestSetup) SetupSwiftTest()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestClient ¶
CreateTestClient setup an httpexpect.Expect client used to make http tests.
This init take allow to use the `--debug` flag in your tests in order to print the requests/responses content.
example: `go test ./web/permissions --debug`.
func NeedCouchdb ¶
NeedCouchdb kill the process if there is no couchdb running
func TODO ¶
TODO can be used as a reminder to do something in the future. The test that calls TODO will fail after the limit date, which is an efficient way to not forget about it.
func WithManager ¶
Types ¶
type ManagerConfig ¶
type TestSetup ¶
type TestSetup struct {
// contains filtered or unexported fields
}
TestSetup is a wrapper around a testing.M which handles setting up instance, client, VFSContext, testserver and cleaning up after itself
func NewSetup ¶
NewSetup returns a new TestSetup name is used to prevent bug when tests are run in parallel
func (*TestSetup) GetTestAdminClient ¶
GetTestAdminClient creates an oauth client and associated token with access to admin routes
func (*TestSetup) GetTestClient ¶
GetTestClient creates an oauth client and associated token
func (*TestSetup) GetTestInstance ¶
GetTestInstance creates an instance with a random host The instance will be removed on container cleanup
func (*TestSetup) GetTestServer ¶
func (c *TestSetup) GetTestServer(prefix string, routes func(*echo.Group), mws ...func(*echo.Echo) *echo.Echo) *httptest.Server
GetTestServer start a testServer with a single group on prefix The server will be closed on container cleanup
func (*TestSetup) GetTestServerMultipleRoutes ¶
func (c *TestSetup) GetTestServerMultipleRoutes(mpr map[string]func(*echo.Group), mws ...func(*echo.Echo) *echo.Echo) *httptest.Server
GetTestServerMultipleRoutes starts a testServer and creates a group for each pair of (prefix, routes) given. The server will be closed on container cleanup.
func (*TestSetup) InstallMiniApp ¶
func (*TestSetup) InstallMiniClientSideKonnector ¶
func (*TestSetup) InstallMiniKonnector ¶
func (*TestSetup) SetupSwiftTest ¶
func (c *TestSetup) SetupSwiftTest()
SetupSwiftTest can be used to start an in-memory Swift server for tests.