Documentation
¶
Index ¶
- Variables
- func ContainsCollectionWithName(collections []*service.MetabaseCollection, expectedName string) bool
- func ContainsPermissionGroupWithNamePrefix(permissionGroups []service.MetabasePermissionGroup, prefix string) bool
- func ContainsServiceAccount(serviceAccounts map[string]*iam.ServiceAccount, prefix, postfix string) bool
- func CreateMultipartFormRequest(t *testing.T, method, path string, files map[string]string, ...) *http.Request
- func GetFreePort(t *testing.T) int
- func Marshal(t *testing.T, v interface{}) []byte
- func NewContainers(t *testing.T, log zerolog.Logger) *containers
- func NewDataProductAquacultureFeed(group string, teamID uuid.UUID) service.NewDataproduct
- func NewDataProductBiofuelProduction(group string, teamID uuid.UUID) service.NewDataproduct
- func NewDataProductProtectiveBarriers(group string, teamID uuid.UUID) service.NewDataproduct
- func NewDataProductReefMonitoring(group string, teamID uuid.UUID) service.NewDataproduct
- func NewDatasetBiofuelConsumptionRates(dataProductID uuid.UUID) service.NewDataset
- func NewDatasetBiofuelConsumptionRatesSchema() []*bigQueryEmulator.Dataset
- func NewInsightProductAquacultureFeed(group string, teamID uuid.UUID) service.NewInsightProduct
- func NewInsightProductBiofuelProduction(group string, teamID uuid.UUID) service.NewInsightProduct
- func NewInsightProductProtectiveBarriers(group string, teamID uuid.UUID) service.NewInsightProduct
- func NewInsightProductReefMonitoring(group string, teamID uuid.UUID) service.NewInsightProduct
- func NewStoryAquacultureFeed(group string) service.NewStory
- func NewStoryBiofuelProduction(group string) service.NewStory
- func NewStoryProtectiveBarriers(group string) service.NewStory
- func NewStoryReefMonitoring(group string) service.NewStory
- func NewTester(t *testing.T, s *httptest.Server) *testRunner
- func SendRequest(t *testing.T, method, url string, body io.Reader, headers map[string]string) *http.Response
- func StorageCreateDataproduct(t *testing.T, storage service.DataProductsStorage, ndp service.NewDataproduct) *service.DataproductMinimal
- func StorageCreateInsightProduct(t *testing.T, userEmail string, storage service.InsightProductStorage, ...) *service.InsightProduct
- func StorageCreateNaisConsoleTeamsAndProjects(t *testing.T, storage service.NaisConsoleStorage, teams map[string]string)
- func StorageCreateProductAreasAndTeams(t *testing.T, storage service.ProductAreaStorage)
- func StorageCreateStory(t *testing.T, storage service.StoryStorage, creator string, ...) *service.Story
- func TestRouter(log zerolog.Logger) chi.Router
- func Unmarshal(t *testing.T, r io.Reader, v interface{})
- type CleanupFn
- type MetabaseConfig
- type PostgresConfig
- type TestRunner
- type TestRunnerEnder
- type TestRunnerStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProductAreaOceanicID = uuid.MustParse("00000000-0000-0000-0000-000000000001") ProductAreaOceanicName = "Oceanic" ProductAreaCostalID = uuid.MustParse("00000000-0000-0000-0000-000000000002") ProductAreaCostalName = "Costal" TeamSeagrassID = uuid.MustParse("00000000-0000-0000-0000-000000000003") TeamSeagrassName = "Seagrass" TeamReefID = uuid.MustParse("00000000-0000-0000-0000-000000000004") TeamReefName = "Reef" GroupNameReef = "reef" GroupEmailReef = "reef@nav.no" UserOneName = "User Userson" UserOneEmail = "user.userson@email.com" UserTwoName = "Another Userson" UserTwoEmail = "another.userson@email.com" GroupNameNada = "nada" GroupEmailNada = "nada@nav.no" NaisTeamNada = "nada" GroupNameAllUsers = "all-users" GroupEmailAllUsers = "all-users@nav.no" Project = "test-project" Location = "europe-north1" PseudoDataSet = "pseudo-test-dataset" UserOne = &service.User{ Name: UserOneName, Email: UserOneEmail, GoogleGroups: []service.Group{ { Name: GroupNameNada, Email: GroupEmailNada, }, { Name: GroupNameAllUsers, Email: GroupEmailAllUsers, }, }, } UserTwo = &service.User{ Name: UserTwoName, Email: UserTwoEmail, GoogleGroups: []service.Group{ { Name: GroupNameAllUsers, Email: GroupEmailAllUsers, }, }, } )
Functions ¶
func ContainsCollectionWithName ¶
func ContainsCollectionWithName(collections []*service.MetabaseCollection, expectedName string) bool
func ContainsPermissionGroupWithNamePrefix ¶
func ContainsPermissionGroupWithNamePrefix(permissionGroups []service.MetabasePermissionGroup, prefix string) bool
func ContainsServiceAccount ¶
func GetFreePort ¶
func NewDataProductAquacultureFeed ¶
func NewDataProductAquacultureFeed(group string, teamID uuid.UUID) service.NewDataproduct
func NewDataProductBiofuelProduction ¶
func NewDataProductBiofuelProduction(group string, teamID uuid.UUID) service.NewDataproduct
func NewDataProductProtectiveBarriers ¶
func NewDataProductProtectiveBarriers(group string, teamID uuid.UUID) service.NewDataproduct
func NewDataProductReefMonitoring ¶
func NewDataProductReefMonitoring(group string, teamID uuid.UUID) service.NewDataproduct
func NewDatasetBiofuelConsumptionRates ¶
func NewDatasetBiofuelConsumptionRates(dataProductID uuid.UUID) service.NewDataset
func NewDatasetBiofuelConsumptionRatesSchema ¶
func NewDatasetBiofuelConsumptionRatesSchema() []*bigQueryEmulator.Dataset
func NewInsightProductAquacultureFeed ¶
func NewInsightProductAquacultureFeed(group string, teamID uuid.UUID) service.NewInsightProduct
func NewInsightProductBiofuelProduction ¶
func NewInsightProductBiofuelProduction(group string, teamID uuid.UUID) service.NewInsightProduct
func NewInsightProductProtectiveBarriers ¶
func NewInsightProductProtectiveBarriers(group string, teamID uuid.UUID) service.NewInsightProduct
func NewInsightProductReefMonitoring ¶
func NewInsightProductReefMonitoring(group string, teamID uuid.UUID) service.NewInsightProduct
func NewStoryAquacultureFeed ¶
func NewStoryReefMonitoring ¶
func SendRequest ¶
func StorageCreateDataproduct ¶
func StorageCreateDataproduct(t *testing.T, storage service.DataProductsStorage, ndp service.NewDataproduct) *service.DataproductMinimal
func StorageCreateInsightProduct ¶
func StorageCreateInsightProduct(t *testing.T, userEmail string, storage service.InsightProductStorage, nip service.NewInsightProduct) *service.InsightProduct
func StorageCreateProductAreasAndTeams ¶
func StorageCreateProductAreasAndTeams(t *testing.T, storage service.ProductAreaStorage)
func StorageCreateStory ¶
Types ¶
type MetabaseConfig ¶
type MetabaseConfig struct { FirstName string LastName string Email string Password string SiteName string // PremiumEmbeddingToken is populated from the environment. PremiumEmbeddingToken string // HostPort is populated after the container is started. HostPort string }
func NewMetabaseConfig ¶
func NewMetabaseConfig() *MetabaseConfig
func (*MetabaseConfig) ConnectionURL ¶
func (m *MetabaseConfig) ConnectionURL() string
func (*MetabaseConfig) SessionPropertiesURL ¶
func (m *MetabaseConfig) SessionPropertiesURL() string
func (*MetabaseConfig) SetupBody ¶
func (m *MetabaseConfig) SetupBody(token string) *metabaseSetupBody
func (*MetabaseConfig) SetupURL ¶
func (m *MetabaseConfig) SetupURL() string
type PostgresConfig ¶
type PostgresConfig struct { User string Password string Database string // HostPort is populated after the container is started. HostPort string }
func NewPostgresConfig ¶
func NewPostgresConfig() *PostgresConfig
func (*PostgresConfig) ConnectionURL ¶
func (c *PostgresConfig) ConnectionURL() string
type TestRunner ¶
type TestRunner interface { Post(input any, path string, params ...string) TestRunnerStatus Get(path string, params ...string) TestRunnerStatus Put(input any, path string, params ...string) TestRunnerStatus Delete(path string, params ...string) TestRunnerStatus Headers(headers map[string]string) TestRunner Send(r *http.Request) TestRunnerStatus }
type TestRunnerEnder ¶
type TestRunnerStatus ¶
type TestRunnerStatus interface { Debug(out io.Writer) TestRunnerStatus HasStatusCode(code int) TestRunnerEnder }
Click to show internal directories.
Click to hide internal directories.