Skip to content

Commit

Permalink
Added tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Apr 30, 2024
1 parent 026afc6 commit 431c5d3
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,6 @@ resource "null_resource" "validator" {
null_resource.deployment_wait
]
provisioner "local-exec" {
command = "go test ${var.test_dir} -v"
command = "go test ${var.test_dir} -v --tags=windowslinux"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ resource "null_resource" "validator" {
helm_release.this
]
provisioner "local-exec" {
command = "go test ${var.test_dir} -v"
command = "go test ${var.test_dir} -v --tags=linuxonly"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build linuxonly
// +build linuxonly

package validator

const (
// Services count for CW agent on Linux and Windows
serviceCountLinux = 6
serviceCountWindows = 3

// DaemonSet count for CW agent on Linux and Windows
daemonsetCountLinux = 4
daemonsetCountWindows = 2

// Pods count for CW agent on Linux and Windows
podCountLinux = 3
podCountWindows = 0
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build windowslinux
// +build windowslinux

package validator

const (
// Services count for CW agent on Linux and Windows
serviceCountLinux = 6
serviceCountWindows = 3

// DaemonSet count for CW agent on Linux and Windows
daemonsetCountLinux = 4
daemonsetCountWindows = 2

// Pods count for CW agent on Linux and Windows
podCountLinux = 3
podCountWindows = 2
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build linuxonly || windowslinux
// +build linuxonly windowslinux

package validator

import (
Expand Down Expand Up @@ -36,6 +39,10 @@ const (
serviceNameRegex = agentName + "(-headless|-monitoring)?|" + agentNameWindows + "(-headless|-monitoring)?|" + addOnName + "-webhook-service|" + dcgmExporterName + "-service|" + neuronMonitor + "-service"
)

const (
podCount = podCountLinux + podCountWindows
)

func TestOperatorOnEKs(t *testing.T) {
userHomeDir, err := os.UserHomeDir()
if err != nil {
Expand Down Expand Up @@ -63,7 +70,7 @@ func TestOperatorOnEKs(t *testing.T) {
//Validating the number of pods and status
pods, err := ListPods(nameSpace, clientSet)
assert.NoError(t, err)
assert.Len(t, pods.Items, 5)
assert.Len(t, pods.Items, 3)
for _, pod := range pods.Items {
fmt.Println("pod name: " + pod.Name + " namespace:" + pod.Namespace)
assert.Contains(t, []v1.PodPhase{v1.PodRunning, v1.PodPending}, pod.Status.Phase)
Expand Down

0 comments on commit 431c5d3

Please sign in to comment.