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

test: add hubble control plane to scale test #1077

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .github/workflows/scale-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ on:
image_tag:
description: "Image Tag (if not set, default for this commit will be used)"
type: string
control_plane:
description: "Control Plane"
type: choice
required: true
options:
- "legacy"
- "hubble"
num_deployments:
description: "Number of Traffic Deployments"
default: 1000
Expand Down Expand Up @@ -100,6 +107,7 @@ jobs:
IMAGE_NAMESPACE: ${{ github.repository }}
TAG: ${{ inputs.image_tag }}
AZURE_APP_INSIGHTS_KEY: ${{ secrets.AZURE_APP_INSIGHTS_KEY }}
HUBBLE_CONTROL_PLANE: ${{ inputs.control_plane == 'hubble' }}
shell: bash
run: |
set -euo pipefail
Expand Down
17 changes: 17 additions & 0 deletions test/e2e/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"flag"
"os"
"os/user"
"path/filepath"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -46,3 +47,19 @@ func ClusterNameForE2ETest(t *testing.T) string {
}
return clusterName
}

func RetinaChartPath(hubbleControlPlane bool) (string, error) {
cwd, err := os.Getwd()
if err != nil {
return "", err
}

rootDir := filepath.Dir(filepath.Dir(cwd))
controlPlane := "legacy"

if hubbleControlPlane {
controlPlane = "hubble"
}

return filepath.Join(rootDir, "deploy", controlPlane, "manifests", "controller", "helm", "retina"), nil
}
20 changes: 17 additions & 3 deletions test/e2e/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,23 @@ func DeleteTestInfra(subID, rg, clusterName, location string) *types.Job {
return job
}

func InstallRetina(kubeConfigFilePath, chartPath string) *types.Job {
job := types.NewJob("Install and test Retina with basic metrics")
func InstallRetina(kubeConfigFilePath, chartPath string, hubbleControlPlane bool) *types.Job {
if hubbleControlPlane {
job := types.NewJob("Install Retina with Hubble Control Plane")

// Install Retina with Hubble Control Plane
job.AddStep(&kubernetes.ValidateHubbleStep{
Namespace: common.KubeSystemNamespace,
ReleaseName: "retina",
KubeConfigFilePath: kubeConfigFilePath,
ChartPath: chartPath,
TagEnv: generic.DefaultTagEnv,
}, nil)

return job
}

job := types.NewJob("Install Retina with Legacy Control Plane")
BeegiiK marked this conversation as resolved.
Show resolved Hide resolved

job.AddStep(&kubernetes.InstallHelmChart{
Namespace: common.KubeSystemNamespace,
Expand Down Expand Up @@ -365,4 +380,3 @@ func RunPerfTest(kubeConfigFilePath string, chartPath string) *types.Job {

return job
}

12 changes: 10 additions & 2 deletions test/e2e/scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"testing"

"github.com/microsoft/retina/test/e2e/common"
Expand Down Expand Up @@ -49,7 +50,6 @@ func TestE2ERetina_Scale(t *testing.T) {
// Get to root of the repo by going up two directories
rootDir := filepath.Dir(filepath.Dir(cwd))

chartPath := filepath.Join(rootDir, "deploy", "legacy", "manifests", "controller", "helm", "retina")
kubeConfigFilePath := filepath.Join(rootDir, "test", "e2e", "test.pem")

// Scale test parameters
Expand Down Expand Up @@ -103,8 +103,16 @@ func TestE2ERetina_Scale(t *testing.T) {
require.NoError(t, err)
opt.AdditionalTelemetryProperty["clusterFqdn"] = fqdn

var hubbleControlPlane bool
if strings.ToLower(os.Getenv("HUBBLE_CONTROL_PLANE")) == "true" {
hubbleControlPlane = true
}

chartPath, err := common.RetinaChartPath(hubbleControlPlane)
require.NoError(t, err)

// Install Retina
installRetina := types.NewRunner(t, jobs.InstallRetina(kubeConfigFilePath, chartPath))
installRetina := types.NewRunner(t, jobs.InstallRetina(kubeConfigFilePath, chartPath, hubbleControlPlane))
installRetina.Run(ctx)

t.Cleanup(func() {
Expand Down
Loading