Documentation ¶
Index ¶
- Constants
- Variables
- func AddFile(path, contents string)
- func AddSignedFile(path, contents string)
- func AddSignedTag(name string)
- func AddTag(name string)
- func AppNamespace() string
- func CreateSecret(username, password string) string
- func CreateSubmoduleRepos(repoType string)
- func Declarative(filename string, values interface{}) (string, error)
- func Delete(path string)
- func DeploymentNamespace() string
- func DnsFriendly(str string, postfix string) string
- func DoHttpJsonRequest(method string, path string, result interface{}, data ...byte) error
- func DoHttpRequest(method string, path string, data ...byte) (*http.Response, error)
- func EnsureCleanState(t *testing.T, opts ...TestOption)
- func GetApiResources() string
- func GetApiServerAddress() string
- func GetEnvWithDefault(envName, defaultValue string) string
- func GetToken() string
- func IsLocal() bool
- func IsRemote() bool
- func LocalOrRemotePath(base string) string
- func LoginAs(username string)
- func Name() string
- func NormalizeOutput(text string) string
- func Patch(path string, jsonPatch string)
- func RecordTestRun(t *testing.T)
- func RemoveSubmodule()
- func RepoBaseURL(urlType RepoURLType) string
- func RepoURL(urlType RepoURLType) string
- func RestartAPIServer()
- func RestartRepoServer()
- func Run(workDir, name string, args ...string) (string, error)
- func RunCli(args ...string) (string, error)
- func RunCliWithRetry(maxRetries int, args ...string) (string, error)
- func RunCliWithStdin(stdin string, isKubeConextOnlyCli bool, args ...string) (string, error)
- func RunWithStdin(stdin, workDir, name string, args ...string) (string, error)
- func SetAccounts(accounts map[string][]string)
- func SetEnableManifestGeneration(val map[v1alpha1.ApplicationSourceType]bool)
- func SetHelmRepos(repos ...settings.HelmRepoCredentials)
- func SetParamInNotificationsConfigMap(key, value string)
- func SetParamInSettingConfigMap(key, value string)
- func SetPermissions(permissions []ACL, username string, roleName string)
- func SetProjectSpec(project string, spec v1alpha1.AppProjectSpec)
- func SetRepos(repos ...settings.RepositoryCredentials)
- func SetResourceFilter(filters settings.ResourcesFilter)
- func SetResourceOverrides(overrides map[string]v1alpha1.ResourceOverride)
- func SetResourceOverridesSplitKeys(overrides map[string]v1alpha1.ResourceOverride)
- func SetTrackingLabel(trackingLabel string)
- func SetTrackingMethod(trackingMethod string)
- func SkipIfAlreadyRun(t *testing.T)
- func SkipOnEnv(t *testing.T, suffixes ...string)
- func TestNamespace() string
- func Tmpl(text string, values interface{}) string
- func WriteFile(path, contents string)
- type ACL
- type RepoURLType
- type TestOption
- type Version
- type Versions
Constants ¶
const ( DefaultTestUserPassword = "password" TestingLabel = "e2e.argoproj.io" ArgoCDNamespace = "argocd-e2e" ArgoCDAppNamespace = "argocd-e2e-external" // ensure all repos are in one directory tree, so we can easily clean them up TmpDir = "/tmp/argo-e2e" GuestbookPath = "guestbook" ProjectName = "argo-project" // cmp plugin sock file path PluginSockFilePath = "/app/config/plugin" E2ETestPrefix = "e2e-test-" )
const ( EnvAdminUsername = "ARGOCD_E2E_ADMIN_USERNAME" EnvAdminPassword = "ARGOCD_E2E_ADMIN_PASSWORD" EnvArgoCDServerName = "ARGOCD_E2E_SERVER_NAME" EnvArgoCDRedisHAProxyName = "ARGOCD_E2E_REDIS_HAPROXY_NAME" EnvArgoCDRedisName = "ARGOCD_E2E_REDIS_NAME" EnvArgoCDRepoServerName = "ARGOCD_E2E_REPO_SERVER_NAME" EnvArgoCDAppControllerName = "ARGOCD_E2E_APPLICATION_CONTROLLER_NAME" )
const ( RepoURLTypeFile = "file" RepoURLTypeHTTPS = "https" RepoURLTypeHTTPSOrg = "https-org" RepoURLTypeHTTPSClientCert = "https-cc" RepoURLTypeHTTPSSubmodule = "https-sub" RepoURLTypeHTTPSSubmoduleParent = "https-par" RepoURLTypeSSH = "ssh" RepoURLTypeSSHSubmodule = "ssh-sub" RepoURLTypeSSHSubmoduleParent = "ssh-par" RepoURLTypeHelm = "helm" RepoURLTypeHelmParent = "helm-par" RepoURLTypeHelmOCI = "helm-oci" GitUsername = "admin" GitPassword = "password" GithubAppID = "2978632978" GithubAppInstallationID = "7893789433789" GpgGoodKeyID = "D56C4FCA57A46444" HelmOCIRegistryURL = "localhost:5000/myrepo" )
const ( EnvRepoURLTypeSSH = "ARGOCD_E2E_REPO_SSH" EnvRepoURLTypeSSHSubmodule = "ARGOCD_E2E_REPO_SSH_SUBMODULE" EnvRepoURLTypeSSHSubmoduleParent = "ARGOCD_E2E_REPO_SSH_SUBMODULE_PARENT" EnvRepoURLTypeHTTPS = "ARGOCD_E2E_REPO_HTTPS" EnvRepoURLTypeHTTPSOrg = "ARGOCD_E2E_REPO_HTTPS_ORG" EnvRepoURLTypeHTTPSClientCert = "ARGOCD_E2E_REPO_HTTPS_CLIENT_CERT" EnvRepoURLTypeHTTPSSubmodule = "ARGOCD_E2E_REPO_HTTPS_SUBMODULE" EnvRepoURLTypeHTTPSSubmoduleParent = "ARGOCD_E2E_REPO_HTTPS_SUBMODULE_PARENT" EnvRepoURLTypeHelm = "ARGOCD_E2E_REPO_HELM" EnvRepoURLDefault = "ARGOCD_E2E_REPO_DEFAULT" )
Variables ¶
var ( KubeClientset kubernetes.Interface KubeConfig *rest.Config DynamicClientset dynamic.Interface AppClientset appclientset.Interface ArgoCDClientset apiclient.Client AdminPassword string )
Functions ¶
func AddSignedFile ¶
func AddSignedFile(path, contents string)
func AddSignedTag ¶ added in v2.5.18
func AddSignedTag(name string)
func AppNamespace ¶ added in v2.5.0
func AppNamespace() string
func CreateSecret ¶
creates a secret for the current test, this currently can only create a single secret
func CreateSubmoduleRepos ¶
func CreateSubmoduleRepos(repoType string)
func Declarative ¶
create the resource by creating using "kubectl apply", with bonus templating
func DeploymentNamespace ¶
func DeploymentNamespace() string
func DnsFriendly ¶
returns dns friends string which is no longer than 63 characters and has specified postfix at the end
func DoHttpJsonRequest ¶ added in v2.3.0
DoHttpJsonRequest executes a http request against the Argo CD API server and unmarshals the response body as JSON
func DoHttpRequest ¶ added in v2.3.0
DoHttpRequest executes a http request against the Argo CD API server
func EnsureCleanState ¶
func EnsureCleanState(t *testing.T, opts ...TestOption)
func GetApiResources ¶ added in v2.2.0
func GetApiResources() string
func GetApiServerAddress ¶ added in v2.13.0
func GetApiServerAddress() string
func GetEnvWithDefault ¶ added in v2.1.0
func IsLocal ¶ added in v2.1.0
func IsLocal() bool
IsLocal returns when the tests are being run against a local workload
func IsRemote ¶ added in v2.1.0
func IsRemote() bool
IsRemote returns true when the tests are being run against a workload that is running in a remote cluster.
func LocalOrRemotePath ¶ added in v2.1.0
LocalOrRemotePath selects a path for a given application based on whether tests are running local or remote.
func NormalizeOutput ¶
utility method to deal with white-space
func RecordTestRun ¶ added in v2.1.0
RecordTestRun records a test that has been run successfully to a text file, so that it can be automatically skipped if requested.
func RemoveSubmodule ¶ added in v2.8.0
func RemoveSubmodule()
func RepoBaseURL ¶
func RepoBaseURL(urlType RepoURLType) string
func RepoURL ¶
func RepoURL(urlType RepoURLType) string
func RestartAPIServer ¶ added in v2.1.0
func RestartAPIServer()
RestartAPIServer performs a restart of the API server deployemt and waits until the rollout has completed.
func RestartRepoServer ¶ added in v2.1.0
func RestartRepoServer()
RestartRepoServer performs a restart of the repo server deployment and waits until the rollout has completed.
func RunCliWithRetry ¶ added in v2.7.0
func RunCliWithStdin ¶
func SetAccounts ¶
func SetEnableManifestGeneration ¶ added in v2.3.0
func SetEnableManifestGeneration(val map[v1alpha1.ApplicationSourceType]bool)
func SetHelmRepos ¶
func SetHelmRepos(repos ...settings.HelmRepoCredentials)
func SetParamInNotificationsConfigMap ¶ added in v2.5.0
func SetParamInNotificationsConfigMap(key, value string)
func SetParamInSettingConfigMap ¶ added in v2.4.0
func SetParamInSettingConfigMap(key, value string)
func SetPermissions ¶ added in v2.2.0
func SetProjectSpec ¶
func SetProjectSpec(project string, spec v1alpha1.AppProjectSpec)
func SetRepos ¶
func SetRepos(repos ...settings.RepositoryCredentials)
func SetResourceFilter ¶
func SetResourceFilter(filters settings.ResourcesFilter)
func SetResourceOverrides ¶
func SetResourceOverrides(overrides map[string]v1alpha1.ResourceOverride)
func SetResourceOverridesSplitKeys ¶ added in v2.1.0
func SetResourceOverridesSplitKeys(overrides map[string]v1alpha1.ResourceOverride)
func SetTrackingLabel ¶ added in v2.4.6
func SetTrackingLabel(trackingLabel string)
func SetTrackingMethod ¶ added in v2.2.0
func SetTrackingMethod(trackingMethod string)
func SkipIfAlreadyRun ¶ added in v2.1.0
SkipIfAlreadyRun skips a test if it has been already run by a previous test cycle and was recorded.
func SkipOnEnv ¶ added in v2.1.0
SkipOnEnv allows to skip a test when a given environment variable is set. Environment variable names follow the ARGOCD_E2E_SKIP_<suffix> pattern, and must be set to the string value 'true' in order to skip a test.
func TestNamespace ¶ added in v2.1.0
func TestNamespace() string
TestNamespace returns the namespace where Argo CD E2E test instance will be running in.
Types ¶
type RepoURLType ¶
type RepoURLType string
type TestOption ¶ added in v2.6.8
type TestOption func(option *testOption)
func WithTestData ¶ added in v2.6.8
func WithTestData(testdata string) TestOption