Skip to content

Commit

Permalink
Merge pull request #23 from joelsmith/main
Browse files Browse the repository at this point in the history
UPSTREAM: 5595: Add more granular control to E2E test setup
  • Loading branch information
openshift-merge-bot[bot] authored Mar 12, 2024
2 parents 60aea7b + fe75a20 commit 9e891e5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
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

0 comments on commit 9e891e5

Please sign in to comment.