Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add more granular control to E2E test setup #5595

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ New deprecation(s):

### Other

- **General**: Allow E2E tests to be run against existing KEDA and/or Kafka installation ([#5595](https://github.com/kedacore/keda/pull/5595))
- **General**: Improve readability of utility function getParameterFromConfigV2 ([#5037](https://github.com/kedacore/keda/issues/5037))
- **General**: Introduce ENABLE_OPENTELEMETRY in deploying/testing process ([#5375](https://github.com/kedacore/keda/issues/5375)|[#5578](https://github.com/kedacore/keda/issues/5578))
- **General**: Migrate away from unmaintained golang/mock and use uber/gomock ([#5440](https://github.com/kedacore/keda/issues/5440))
Expand Down
2 changes: 2 additions & 0 deletions tests/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ var (
GcpIdentityTests = os.Getenv("GCP_RUN_IDENTITY_TESTS")
EnableOpentelemetry = os.Getenv("ENABLE_OPENTELEMETRY")
InstallCertManager = AwsIdentityTests == StringTrue || GcpIdentityTests == StringTrue
InstallKeda = os.Getenv("E2E_INSTALL_KEDA")
InstallKafka = os.Getenv("E2E_INSTALL_KAFKA")
)

var (
Expand Down
8 changes: 8 additions & 0 deletions tests/utils/cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import (
)

func TestRemoveKEDA(t *testing.T) {
// default to true
if InstallKeda == StringFalse {
t.Skip("skipping as requested -- KEDA not installed via these tests")
}
out, err := ExecuteCommandWithDir("make undeploy", "../..")
require.NoErrorf(t, err, "error removing KEDA - %s", err)

Expand Down Expand Up @@ -89,6 +93,10 @@ func TestRemoveAzureManagedPrometheusComponents(t *testing.T) {
}

func TestRemoveStrimzi(t *testing.T) {
// default to true
if InstallKafka == StringFalse {
t.Skip("skipping as requested -- Kafka not managed by E2E tests")
}
_, err := ExecuteCommand(fmt.Sprintf(`helm uninstall --namespace %s %s`,
StrimziNamespace,
StrimziChartName))
Expand Down
12 changes: 12 additions & 0 deletions tests/utils/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ func TestSetupOpentelemetryComponents(t *testing.T) {
}

func TestDeployKEDA(t *testing.T) {
// default to true
if InstallKeda == StringFalse {
t.Skip("skipping as requested -- KEDA assumed to be already installed")
}
KubeClient = GetKubernetesClient(t)
CreateNamespace(t, KubeClient, KEDANamespace)

Expand All @@ -229,6 +233,10 @@ func TestDeployKEDA(t *testing.T) {
}

func TestVerifyKEDA(t *testing.T) {
// default to true
if InstallKeda == StringFalse {
t.Skip("skipping as requested -- KEDA assumed to be already installed")
}
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, KEDAOperator, KEDANamespace, 1, 30, 6),
"replica count should be 1 after 3 minutes")
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, KEDAMetricsAPIServer, KEDANamespace, 1, 30, 6),
Expand Down Expand Up @@ -268,6 +276,10 @@ func TestSetupAadPodIdentityComponents(t *testing.T) {
}

func TestSetUpStrimzi(t *testing.T) {
// default to true
if InstallKafka == StringFalse {
t.Skip("skipping as requested -- Kafka assumed to be unneeded or already installed")
}
t.Log("--- installing kafka operator ---")
_, err := ExecuteCommand("helm repo add strimzi https://strimzi.io/charts/")
assert.NoErrorf(t, err, "cannot execute command - %s", err)
Expand Down
Loading