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

UPSTREAM: 5595: Add more granular control to E2E test setup #23

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 @@ -96,6 +96,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**: Introduce ENABLE_OPENTELEMETRY in deploying/testing process ([#5375](https://github.com/kedacore/keda/issues/5375))

## v2.12.0
Expand Down
2 changes: 2 additions & 0 deletions tests/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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 @@ -100,6 +104,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 @@ -201,6 +201,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 @@ -226,6 +230,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 @@ -265,6 +273,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