tconfig

package
v0.0.0-...-1b842a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// S3 config
	TestCfgBucket          = "bucket"
	TestCfgEndpoint        = "endpoint"
	TestCfgPrefix          = "prefix"
	TestCfgStorageProvider = "provider"
	TestCfgFilesystemPath  = "path"

	// M365 config
	TestCfgAzureTenantID    = "azure_tenantid"
	TestCfgSecondarySiteID  = "secondarym365siteid"
	TestCfgSiteID           = "m365siteid"
	TestCfgSiteURL          = "m365siteurl"
	TestCfgTeamID           = "m365teamid"
	TestCfgTeamEmail        = "m365teamemail"
	TestCfgTeamSiteID       = "m365teamsiteid"
	TestCfgGroupID          = "m365groupid"
	TestCfgUserID           = "m365userid"
	TestCfgSecondaryUserID  = "secondarym365userid"
	TestCfgSecondaryGroupID = "secondarym365groupid"
	TestCfgSecondaryTeamID  = "secondarym365teamid"
	TestCfgTertiaryUserID   = "tertiarym365userid"
	TestCfgLoadTestUserID   = "loadtestm365userid"
	TestCfgLoadTestOrgUsers = "loadtestm365orgusers"
	TestCfgAccountProvider  = "account_provider"
	TestCfgUnlicensedUserID = "unlicensedm365userid"
)
View Source
const (
	EnvCorsoM365LoadTestUserID       = "CORSO_M365_LOAD_TEST_USER_ID"
	EnvCorsoM365LoadTestOrgUsers     = "CORSO_M365_LOAD_TEST_ORG_USERS"
	EnvCorsoM365TestSiteID           = "CORSO_M365_TEST_SITE_ID"
	EnvCorsoM365TestSiteURL          = "CORSO_M365_TEST_SITE_URL"
	EnvCorsoM365TestTeamID           = "CORSO_M365_TEST_TEAM_ID"
	EnvCorsoM365TestTeamEmail        = "CORSO_M365_TEST_TEAM_EMAIL"
	EnvCorsoM365TestTeamSiteID       = "CORSO_M365_TEST_TEAM_SITE_ID"
	EnvCorsoSecondaryM365TestTeamID  = "CORSO_SECONDARY_M365_TEST_TEAM_ID"
	EnvCorsoM365TestGroupID          = "CORSO_M365_TEST_GROUP_ID"
	EnvCorsoSecondaryM365TestGroupID = "CORSO_SECONDARY_M365_TEST_GROUP_ID"
	EnvCorsoM365TestUserID           = "CORSO_M365_TEST_USER_ID"
	EnvCorsoSecondaryM365TestSiteID  = "CORSO_SECONDARY_M365_TEST_SITE_ID"
	EnvCorsoSecondaryM365TestUserID  = "CORSO_SECONDARY_M365_TEST_USER_ID"
	EnvCorsoTertiaryM365TestUserID   = "CORSO_TERTIARY_M365_TEST_USER_ID"
	EnvCorsoTestConfigFilePath       = "CORSO_TEST_CONFIG_FILE"
	EnvCorsoUnlicensedM365TestUserID = "CORSO_M365_TEST_UNLICENSED_USER"
)

test specific env vars

View Source
const (
	// commonly used drive names
	LibraryDocuments     = "Documents"
	LibraryMoreDocuments = "More Documents"
)

SharePoint

Variables

Functions

func GetM365SiteID

func GetM365SiteID(ctx context.Context) string

GetM365SiteID returns a siteID string representing the m365SiteID described by either the env var CORSO_M365_TEST_SITE_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func GetM365TeamID

func GetM365TeamID(ctx context.Context) string

GetM365TeamID returns a groupID string representing the m365TeamID described by either the env var CORSO_M365_TEST_TEAM_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func GetM365TeamSiteID

func GetM365TeamSiteID(ctx context.Context) string

GetM365TeamSiteID returns a site ID string representing the m365TeamSiteID described by either the env var CORSO_M365_TEST_TEAM_SITE_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func GetM365TenantID

func GetM365TenantID(ctx context.Context) string

M365TenantID returns a tenantID string representing the azureTenantID described by either the env var AZURE_TENANT_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func GetM365UserID

func GetM365UserID(ctx context.Context) string

GetM365UserID returns an userID string representing the m365UserID described by either the env var CORSO_M365_TEST_USER_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func LoadTestM365OrgSites

func LoadTestM365OrgSites(t *testing.T) []string

expects cfg value to be a string representing an array such as: ["site1\,uuid","site2\,uuid"] the delimiter must be a |.

func LoadTestM365OrgUsers

func LoadTestM365OrgUsers(t *testing.T) []string

expects cfg value to be a string representing an array such as: ["foo@example.com","bar@example.com"] the delimiter may be either a , or |.

func LoadTestM365SiteID

func LoadTestM365SiteID(t *testing.T) string

LoadTestM365SiteID returns a siteID string representing the m365SiteID described by either the env var CORSO_M365_LOAD_TEST_SITE_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func LoadTestM365UserID

func LoadTestM365UserID(t *testing.T) string

LoadTestM365UserID returns an userID string representing the m365UserID described by either the env var CORSO_M365_LOAD_TEST_USER_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func M365GroupID

func M365GroupID(t *testing.T) string

M365GroupID returns a groupID string representing the m365GroupID described by either the env var CORSO_M365_TEST_GROUP_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org. NOTE: This Group will not have a Team associated with it.

func M365SiteID

func M365SiteID(t *testing.T) string

M365SiteID returns a siteID string representing the m365SiteID described by either the env var CORSO_M365_TEST_SITE_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func M365SiteURL

func M365SiteURL(t *testing.T) string

M365SiteURL returns a site webURL string representing the m365SiteURL described by either the env var CORSO_M365_TEST_SITE_URL, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func M365TeamEmail

func M365TeamEmail(t *testing.T) string

M365TeamEmail returns a teamEmail string representing the m365TeamsEmail described by either the env var CORSO_M365_TEST_TEAM_EMAIL, the corso_test.toml config file or the default value (in that order of priority) and should belong the same group as the one represented by CORSO_M365_TEST_TEAM_ID. The default is a last-attempt fallback that will only work on alcion's testing org.

func M365TeamID

func M365TeamID(t *testing.T) string

M365TeamID returns a teamID string representing the m365TeamsID described by either the env var CORSO_M365_TEST_TEAM_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func M365TenantID

func M365TenantID(t *testing.T) string

M365TenantID returns a tenantID string representing the azureTenantID described by either the env var AZURE_TENANT_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func M365UserID

func M365UserID(t *testing.T) string

M365UserID returns an userID string representing the m365UserID described by either the env var CORSO_M365_TEST_USER_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func MakeTempTestConfigClone

func MakeTempTestConfigClone(t *testing.T, overrides map[string]string) (*viper.Viper, string)

MakeTempTestConfigClone makes a copy of the test config file in a temp directory. This allows tests which interface with reading and writing to a config file (such as the CLI) to safely manipulate file contents without amending the user's original file.

Attempts to copy values sourced from the caller's test config file. The overrides prop replaces config values with the provided value.

Returns a filepath string pointing to the location of the temp file.

func NewFakeM365Account

func NewFakeM365Account(t *testing.T) account.Account

func NewM365Account

func NewM365Account(t *testing.T) account.Account

NewM365Account returns an account.Account object initialized with environment variables used for integration tests that use the m365 Controller.

func NewTestViper

func NewTestViper() (*viper.Viper, error)

func ReadTestConfig

func ReadTestConfig() (map[string]string, error)

reads a corso configuration file with values specific to local integration test controls. Populates values with defaults where standard.

func SecondaryM365SiteID

func SecondaryM365SiteID(t *testing.T) string

SecondaryM365SiteID returns a siteID string representing the secondarym365SiteID described by either the env var CORSO_SECONDARY_M365_TEST_SITE_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func SecondaryM365TeamID

func SecondaryM365TeamID(t *testing.T) string

SecondaryM365TeamID returns a teamID string representing the secondarym365TeamID described by either the env var CORSO_SECONDARY_M365_TEST_TEAM_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func SecondaryM365UserID

func SecondaryM365UserID(t *testing.T) string

SecondaryM365UserID returns an userID string representing the m365UserID described by either the env var CORSO_SECONDARY_M365_TEST_USER_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func TertiaryM365UserID

func TertiaryM365UserID(t *testing.T) string

TertiaryM365UserID returns an userID string representing the m365UserID described by either the env var CORSO_TERTIARY_M365_TEST_USER_ID, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

func UnlicensedM365UserID

func UnlicensedM365UserID(t *testing.T) string

UnlicensedM365UserID returns an userID string representing the m365UserID described by either the env var CORSO_M365_TEST_UNLICENSED_USER, the corso_test.toml config file or the default value (in that order of priority). The default is a last-attempt fallback that will only work on alcion's testing org.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL