mirror of https://github.com/fluxcd/flux2.git
implement testEnv for e2e tests
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>pull/1697/head
parent
cb96bca6aa
commit
8f78263455
@ -0,0 +1,54 @@
|
||||
// +build e2e
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestInstallNoArgs(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: "install",
|
||||
wantError: false,
|
||||
testClusterMode: ExistingClusterMode,
|
||||
goldenFile: "testdata/install/install_no_args.golden",
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
|
||||
testUninstallSilent(t)
|
||||
time.Sleep(30 * time.Second)
|
||||
}
|
||||
|
||||
func TestInstallExtraComponents(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: "install --components-extra=image-reflector-controller,image-automation-controller",
|
||||
wantError: false,
|
||||
testClusterMode: ExistingClusterMode,
|
||||
goldenFile: "testdata/install/install_extra_components.golden",
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
|
||||
testUninstallSilentForExtraComponents(t)
|
||||
time.Sleep(30 * time.Second)
|
||||
}
|
||||
|
||||
func testUninstallSilent(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: "uninstall -s",
|
||||
wantError: false,
|
||||
testClusterMode: ExistingClusterMode,
|
||||
goldenFile: "testdata/uninstall/uninstall.golden",
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
}
|
||||
|
||||
func testUninstallSilentForExtraComponents(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: "uninstall -s",
|
||||
wantError: false,
|
||||
testClusterMode: ExistingClusterMode,
|
||||
goldenFile: "testdata/uninstall/uninstall_extra_components.golden",
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
✚ generating manifests
|
||||
✔ manifests build completed
|
||||
► installing components in flux-system namespace
|
||||
◎ verifying installation
|
||||
✔ helm-controller: deployment ready
|
||||
✔ image-automation-controller: deployment ready
|
||||
✔ image-reflector-controller: deployment ready
|
||||
✔ kustomize-controller: deployment ready
|
||||
✔ notification-controller: deployment ready
|
||||
✔ source-controller: deployment ready
|
||||
✔ install finished
|
@ -0,0 +1,9 @@
|
||||
✚ generating manifests
|
||||
✔ manifests build completed
|
||||
► installing components in flux-system namespace
|
||||
◎ verifying installation
|
||||
✔ helm-controller: deployment ready
|
||||
✔ kustomize-controller: deployment ready
|
||||
✔ notification-controller: deployment ready
|
||||
✔ source-controller: deployment ready
|
||||
✔ install finished
|
@ -0,0 +1,31 @@
|
||||
► deleting components in flux-system namespace
|
||||
✔ Deployment/flux-system/helm-controller deleted
|
||||
✔ Deployment/flux-system/kustomize-controller deleted
|
||||
✔ Deployment/flux-system/notification-controller deleted
|
||||
✔ Deployment/flux-system/source-controller deleted
|
||||
✔ Service/flux-system/notification-controller deleted
|
||||
✔ Service/flux-system/source-controller deleted
|
||||
✔ Service/flux-system/webhook-receiver deleted
|
||||
✔ NetworkPolicy/flux-system/allow-egress deleted
|
||||
✔ NetworkPolicy/flux-system/allow-scraping deleted
|
||||
✔ NetworkPolicy/flux-system/allow-webhooks deleted
|
||||
✔ ServiceAccount/flux-system/helm-controller deleted
|
||||
✔ ServiceAccount/flux-system/kustomize-controller deleted
|
||||
✔ ServiceAccount/flux-system/notification-controller deleted
|
||||
✔ ServiceAccount/flux-system/source-controller deleted
|
||||
✔ ClusterRole/crd-controller-flux-system deleted
|
||||
✔ ClusterRoleBinding/cluster-reconciler-flux-system deleted
|
||||
✔ ClusterRoleBinding/crd-controller-flux-system deleted
|
||||
► deleting toolkit.fluxcd.io finalizers in all namespaces
|
||||
► deleting toolkit.fluxcd.io custom resource definitions
|
||||
✔ CustomResourceDefinition/alerts.notification.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/buckets.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/gitrepositories.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmcharts.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmreleases.helm.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmrepositories.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/kustomizations.kustomize.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/providers.notification.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/receivers.notification.toolkit.fluxcd.io deleted
|
||||
✔ Namespace/flux-system deleted
|
||||
✔ uninstall finished
|
@ -0,0 +1,38 @@
|
||||
► deleting components in flux-system namespace
|
||||
✔ Deployment/flux-system/helm-controller deleted
|
||||
✔ Deployment/flux-system/image-automation-controller deleted
|
||||
✔ Deployment/flux-system/image-reflector-controller deleted
|
||||
✔ Deployment/flux-system/kustomize-controller deleted
|
||||
✔ Deployment/flux-system/notification-controller deleted
|
||||
✔ Deployment/flux-system/source-controller deleted
|
||||
✔ Service/flux-system/notification-controller deleted
|
||||
✔ Service/flux-system/source-controller deleted
|
||||
✔ Service/flux-system/webhook-receiver deleted
|
||||
✔ NetworkPolicy/flux-system/allow-egress deleted
|
||||
✔ NetworkPolicy/flux-system/allow-scraping deleted
|
||||
✔ NetworkPolicy/flux-system/allow-webhooks deleted
|
||||
✔ ServiceAccount/flux-system/helm-controller deleted
|
||||
✔ ServiceAccount/flux-system/image-automation-controller deleted
|
||||
✔ ServiceAccount/flux-system/image-reflector-controller deleted
|
||||
✔ ServiceAccount/flux-system/kustomize-controller deleted
|
||||
✔ ServiceAccount/flux-system/notification-controller deleted
|
||||
✔ ServiceAccount/flux-system/source-controller deleted
|
||||
✔ ClusterRole/crd-controller-flux-system deleted
|
||||
✔ ClusterRoleBinding/cluster-reconciler-flux-system deleted
|
||||
✔ ClusterRoleBinding/crd-controller-flux-system deleted
|
||||
► deleting toolkit.fluxcd.io finalizers in all namespaces
|
||||
► deleting toolkit.fluxcd.io custom resource definitions
|
||||
✔ CustomResourceDefinition/alerts.notification.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/buckets.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/gitrepositories.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmcharts.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmreleases.helm.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/helmrepositories.source.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/imagepolicies.image.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/imagerepositories.image.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/imageupdateautomations.image.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/kustomizations.kustomize.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/providers.notification.toolkit.fluxcd.io deleted
|
||||
✔ CustomResourceDefinition/receivers.notification.toolkit.fluxcd.io deleted
|
||||
✔ Namespace/flux-system deleted
|
||||
✔ uninstall finished
|
Loading…
Reference in New Issue