Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntegrationTestsEnabled ¶
func IntegrationTestsEnabled() bool
We use an env variable because testing flags will require us to add them to each testing package
Types ¶
type NewTestingUCOpt ¶
type NewTestingUCOpt func(*newTestingOpts)
func WithCredsReaderWriter ¶
func WithCredsReaderWriter(rw credentials.ReaderWriter) NewTestingUCOpt
func WithRegisteredIntegration ¶ added in v0.11.1
func WithRegisteredIntegration(i sdk.FanOut) NewTestingUCOpt
type TestDatabase ¶
type TestDatabase struct {
// contains filtered or unexported fields
}
func NewTestDatabase ¶
func NewTestDatabase(t *testing.T) *TestDatabase
func (*TestDatabase) Close ¶
func (db *TestDatabase) Close(t *testing.T)
func (*TestDatabase) ConnectionString ¶
func (db *TestDatabase) ConnectionString(t *testing.T) string
type TestingUseCases ¶
type TestingUseCases struct { // Misc DB *TestDatabase L log.Logger // Use cases Membership *biz.MembershipUseCase OCIRepo *biz.OCIRepositoryUseCase Integration *biz.IntegrationUseCase Organization *biz.OrganizationUseCase WorkflowContract *biz.WorkflowContractUseCase Workflow *biz.WorkflowUseCase WorkflowRun *biz.WorkflowRunUseCase User *biz.UserUseCase RobotAccount *biz.RobotAccountUseCase RegisteredIntegrations sdk.AvailableExtensions }
TestingUseCases holds all the test data that can be used in the different suites NOTE: It connects to a real database
func NewTestingUseCases ¶
func NewTestingUseCases(t *testing.T, opts ...NewTestingUCOpt) *TestingUseCases
func WireTestData ¶
func WireTestData(testDatabase *TestDatabase, t *testing.T, logger log.Logger, readerWriter credentials.ReaderWriter, builder *robotaccount.Builder, auth *conf.Auth, availableExtensions sdk.AvailableExtensions) (*TestingUseCases, func(), error)
wireTestData init testing data
type UseCasesEachTestSuite ¶
type UseCasesEachTestSuite struct { suite.Suite *TestingUseCases }
Suite that creates a database and sets the schema before each test
func (*UseCasesEachTestSuite) SetupSuite ¶
func (s *UseCasesEachTestSuite) SetupSuite()
Run only if the integration flag is set
func (*UseCasesEachTestSuite) SetupTest ¶
func (s *UseCasesEachTestSuite) SetupTest()
Run before each test
func (*UseCasesEachTestSuite) TearDownTest ¶
func (s *UseCasesEachTestSuite) TearDownTest()
Run after each test
Click to show internal directories.
Click to hide internal directories.