Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
istio-operator: Add e2e test
Browse files Browse the repository at this point in the history
- Adds e2e test to verify if pods are up and running.
- Adds test to verify if the metrics are scraped.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
  • Loading branch information
surajssd committed Jul 21, 2020
1 parent 4634722 commit d5182ca
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
57 changes: 57 additions & 0 deletions test/components/istio/istio_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2020 The Lokomotive Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// +build aws aks aws_edge packet
// +build e2e

package istio_test

import (
"testing"
"time"

testutil "github.com/kinvolk/lokomotive/test/components/util"
)

const (
retryInterval = 3 * time.Second
timeout = 7 * time.Minute
)

func TestIstioDeployments(t *testing.T) {
deployments := []struct {
Namespace string
Deployment string
}{
{
Namespace: "istio-operator",
Deployment: "istio-operator",
},
{
Namespace: "istio-system",
Deployment: "istiod",
},
}

client := testutil.CreateKubeClient(t)

for _, d := range deployments {
d := d
t.Run(d.Deployment, func(t *testing.T) {
t.Parallel()

testutil.WaitForDeployment(t, client, d.Namespace, d.Deployment, retryInterval, timeout)
})
}
}
5 changes: 5 additions & 0 deletions test/monitoring/components_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func testComponentsPrometheusMetrics(t *testing.T, v1api v1.API) {
query: "certmanager_controller_sync_call_count",
platforms: []testutil.Platform{testutil.PlatformPacket, testutil.PlatformAWS, testutil.PlatformAKS},
},
{
componentName: "experimental-istio-operator",
query: "pilot_k8s_reg_events",
platforms: []testutil.Platform{testutil.PlatformPacket, testutil.PlatformAWS, testutil.PlatformAKS},
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit d5182ca

Please sign in to comment.