Documentation ¶
Index ¶
- func GenerateEmail(n int) string
- func GenerateRandomString(n int) string
- func GenerateRandomStringAlpha(n int) string
- func GenerateRandomStringNumeric(n int) string
- func NewTempFile(t *testing.T, name string, content string) string
- func ParseLicense(t *testing.T) *license.License
- type ContainerIntegrationTestSuite
- type Neo4jContainerIntegrationTestSuite
- type PgContainerIntegrationTestSuite
- type RedisContainerIntegrationTestSuite
- func (s *RedisContainerIntegrationTestSuite) CleanupRedis(ts *ContainerIntegrationTestSuite)
- func (s *RedisContainerIntegrationTestSuite) GetKeys(ts *ContainerIntegrationTestSuite, pattern string) []string
- func (s *RedisContainerIntegrationTestSuite) SetupRedis(ts *ContainerIntegrationTestSuite, name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEmail ¶
GenerateEmail returns a random email address for ending with @example.com.
func GenerateRandomString ¶
GenerateRandomString generates a random string of length n.
The string is generated using the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
The length of the string is determined by the n parameter.
The string is not guaranteed to be unique, but with a large enough n, the probability of a collision is very low.
func GenerateRandomStringAlpha ¶
GenerateRandomStringAlpha generates a random string of length n.
The string is generated using the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
The length of the string is determined by the n parameter.
The string is not guaranteed to be unique, but with a large enough n, the probability of a collision is very low.
func GenerateRandomStringNumeric ¶
GenerateRandomStringNumeric generates a random string of length n.
The string is generated using the following characters:
0123456789
The length of the string is determined by the n parameter.
The string is not guaranteed to be unique, but with a large enough n, the probability of a collision is very low.
func NewTempFile ¶
NewTempFile creates a new temporary file with the given name and content.
Types ¶
type ContainerIntegrationTestSuite ¶
ContainerIntegrationTestSuite is a test suite which uses a container to run tests.
func (*ContainerIntegrationTestSuite) AddContainer ¶
func (s *ContainerIntegrationTestSuite) AddContainer(container testcontainers.Container)
AddContainer adds a container to the list of containers to be cleaned up after the test.
func (*ContainerIntegrationTestSuite) CleanupContainers ¶
func (s *ContainerIntegrationTestSuite) CleanupContainers()
CleanupContainers cleans up any containers created during the test.
type Neo4jContainerIntegrationTestSuite ¶
type Neo4jContainerIntegrationTestSuite struct { Neo4jDB *neo4j.Database AssignmentRepo *neo4j.AssignmentRepository AttachmentRepo *neo4j.AttachmentRepository CommentRepo *neo4j.CommentRepository DocumentRepo *neo4j.DocumentRepository IssueRepo *neo4j.IssueRepository LabelRepo *neo4j.LabelRepository LicenseRepo *neo4j.LicenseRepository NamespaceRepo *neo4j.NamespaceRepository OrganizationRepo *neo4j.OrganizationRepository PermissionRepo *neo4j.PermissionRepository ProjectRepo *neo4j.ProjectRepository RoleRepo *neo4j.RoleRepository TodoRepo *neo4j.TodoRepository UserRepo *neo4j.UserRepository }
Neo4jContainerIntegrationTestSuite is a test suite which sets up a Neo4j container to run tests.
func (*Neo4jContainerIntegrationTestSuite) BootstrapNeo4jDatabase ¶
func (s *Neo4jContainerIntegrationTestSuite) BootstrapNeo4jDatabase(ts *ContainerIntegrationTestSuite)
func (*Neo4jContainerIntegrationTestSuite) CleanupNeo4j ¶
func (s *Neo4jContainerIntegrationTestSuite) CleanupNeo4j(ts *ContainerIntegrationTestSuite)
func (*Neo4jContainerIntegrationTestSuite) SetupNeo4j ¶
func (s *Neo4jContainerIntegrationTestSuite) SetupNeo4j(ts *ContainerIntegrationTestSuite, name string)
type PgContainerIntegrationTestSuite ¶
type PgContainerIntegrationTestSuite struct { PostgresDB *pg.Database NotificationRepo *pg.NotificationRepository }
PgContainerIntegrationTestSuite is a test suite which sets up a Postgres container to run tests.
func (*PgContainerIntegrationTestSuite) BootstrapPgDatabase ¶
func (s *PgContainerIntegrationTestSuite) BootstrapPgDatabase(ts *ContainerIntegrationTestSuite)
func (*PgContainerIntegrationTestSuite) CleanupPg ¶
func (s *PgContainerIntegrationTestSuite) CleanupPg(ts *ContainerIntegrationTestSuite)
func (*PgContainerIntegrationTestSuite) SetupPg ¶
func (s *PgContainerIntegrationTestSuite) SetupPg(ts *ContainerIntegrationTestSuite, name string)
type RedisContainerIntegrationTestSuite ¶
type RedisContainerIntegrationTestSuite struct { RedisDB *redis.Database RedisConf *config.CacheDatabaseConfig CachedTodoRepo *redis.CachedTodoRepository }
RedisContainerIntegrationTestSuite is a test suite which sets up a Redis container to run tests.
func (*RedisContainerIntegrationTestSuite) CleanupRedis ¶
func (s *RedisContainerIntegrationTestSuite) CleanupRedis(ts *ContainerIntegrationTestSuite)
func (*RedisContainerIntegrationTestSuite) GetKeys ¶
func (s *RedisContainerIntegrationTestSuite) GetKeys(ts *ContainerIntegrationTestSuite, pattern string) []string
func (*RedisContainerIntegrationTestSuite) SetupRedis ¶
func (s *RedisContainerIntegrationTestSuite) SetupRedis(ts *ContainerIntegrationTestSuite, name string)