Documentation ¶
Index ¶
- func NewMockPolicyRefresher() server.PolicyRefresher
- func NewMockProjectPurger(gyComplete bool) *mockProjectPurger
- func NewMockProjectUpdateManager() *mockProjectUpdateManager
- func WaitForWithTimeout(t *testing.T, f func() bool, timeout time.Duration, message string)
- type MockEventServiceClient
- func (t *MockEventServiceClient) Publish(ctx context.Context, in *automate_event.PublishRequest, ...) (*automate_event.PublishResponse, error)
- func (t *MockEventServiceClient) Start(ctx context.Context, in *automate_event.StartRequest, opts ...grpc.CallOption) (*automate_event.StartResponse, error)
- func (t *MockEventServiceClient) Stop(ctx context.Context, in *automate_event.StopRequest, opts ...grpc.CallOption) (*automate_event.StopResponse, error)
- func (t *MockEventServiceClient) Subscribe(ctx context.Context, in *automate_event.SubscribeRequest, ...) (*automate_event.SubscribeResponse, error)
- type TestDB
- func SetupProjectsAndRulesWithDB(t *testing.T) (api.ProjectsServiceClient, api.PoliciesServiceClient, *TestDB, storage.Storage, ...)
- func SetupTestDB(t *testing.T) (storage.Storage, *TestDB, *opa.State, *prng.Prng, *migration.Config)
- func SetupTestDBWithLimit(t *testing.T, projectLimit int) (storage.Storage, *TestDB, *opa.State, *prng.Prng, *migration.Config)
- type TestFramework
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockPolicyRefresher ¶
func NewMockPolicyRefresher() server.PolicyRefresher
func NewMockProjectPurger ¶
func NewMockProjectPurger(gyComplete bool) *mockProjectPurger
func NewMockProjectUpdateManager ¶
func NewMockProjectUpdateManager() *mockProjectUpdateManager
Types ¶
type MockEventServiceClient ¶
type MockEventServiceClient struct { PublishedEvents int LastestPublishedEvent *automate_event.EventMsg }
func (*MockEventServiceClient) Publish ¶
func (t *MockEventServiceClient) Publish(ctx context.Context, in *automate_event.PublishRequest, opts ...grpc.CallOption) (*automate_event.PublishResponse, error)
func (*MockEventServiceClient) Start ¶
func (t *MockEventServiceClient) Start(ctx context.Context, in *automate_event.StartRequest, opts ...grpc.CallOption) (*automate_event.StartResponse, error)
func (*MockEventServiceClient) Stop ¶
func (t *MockEventServiceClient) Stop(ctx context.Context, in *automate_event.StopRequest, opts ...grpc.CallOption) (*automate_event.StopResponse, error)
func (*MockEventServiceClient) Subscribe ¶
func (t *MockEventServiceClient) Subscribe(ctx context.Context, in *automate_event.SubscribeRequest, opts ...grpc.CallOption) (*automate_event.SubscribeResponse, error)
type TestDB ¶
func SetupProjectsAndRulesWithDB ¶
func SetupProjectsAndRulesWithDB(t *testing.T) ( api.ProjectsServiceClient, api.PoliciesServiceClient, *TestDB, storage.Storage, int64)
SetupProjectsAndRulesWithDB is a simplified test framework useful for integration tests with just the DB.
func SetupTestDB ¶
func SetupTestDBWithLimit ¶
type TestFramework ¶
type TestFramework struct { Policy api.PoliciesServiceClient Authz api.AuthorizationServiceClient Projects api.ProjectsServiceClient TestDB *TestDB Engine engine.Engine Seed int64 PolicyRefresher server.PolicyRefresher GRPC *grpctest.Server ProjectUpdateManager server.ProjectUpdateMgr }
func (*TestFramework) Shutdown ¶
func (tf *TestFramework) Shutdown(t *testing.T, ctx context.Context)
Shutdown must be called at the end of every test that uses TestFramework otherwise strange things might happen with the authz-service/config.Manager because other tests might accidentally get state to its config file if we don't kill the goroutine that writes to it.
Click to show internal directories.
Click to hide internal directories.