Skip to content

Commit

Permalink
Merge pull request #280 from swatisehgal/e2e-test-explicit-address
Browse files Browse the repository at this point in the history
Add test cases for explicit Metric Address to be executed in CI
  • Loading branch information
ffromani authored Apr 9, 2024
2 parents f73a4cc + ef60b62 commit 6a3fe8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,21 @@ jobs:
run: |
kubectl logs -l name=resource-topology -c resource-topology-exporter-container || :
e2e-metrics-https:
e2e-metrics:
strategy:
matrix:
mode: [http, httptls]
address: ["0.0.0.0","127.120.110.100"]
runs-on: ubuntu-22.04
env:
E2E_NODE_REFERENCE: true
E2E_TOPOLOGY_MANAGER_POLICY: single-numa-node
E2E_TOPOLOGY_MANAGER_SCOPE: container
RTE_CONTAINER_IMAGE: quay.io/k8stopologyawarewg/resource-topology-exporter:ci
RTE_METRICS_CLI_AUTH: false
RTE_METRICS_MODE: httptls
RTE_METRICS_MODE: ${{ matrix.mode }}
METRICS_ADDRESS: ${{ matrix.address }}
METRICS_PORT: "2112"
RTE_POLL_INTERVAL: 10s
RTE_VERBOSE: 6
steps:
Expand Down Expand Up @@ -139,6 +145,8 @@ jobs:
RTE_CONTAINER_IMAGE=${RTE_CONTAINER_IMAGE} \
RTE_METRICS_CLI_AUTH=${RTE_METRICS_CLI_AUTH} \
RTE_METRICS_MODE=${RTE_METRICS_MODE} \
METRICS_ADDRESS=${METRICS_ADDRESS} \
METRICS_PORT=${METRICS_PORT} \
RTE_POLL_INTERVAL=${RTE_POLL_INTERVAL} \
RTE_VERBOSE=${RTE_VERBOSE} \
make gen-manifests | tee rte-e2e.yaml
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/rte/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = ginkgo.Describe("[RTE][Monitoring] metrics", func() {
hasMetrics bool
metricsMode string
metricsPort int
MetricsAddress string
metricsAddress string
rtePod *corev1.Pod
workerNodes []corev1.Node
topologyUpdaterNode *corev1.Node
Expand Down Expand Up @@ -100,7 +100,7 @@ var _ = ginkgo.Describe("[RTE][Monitoring] metrics", func() {
rtePod = &pods.Items[0]

if hasMetrics {
MetricsAddress, err = e2ertepod.FindMetricsAddress(rtePod)
metricsAddress, err = e2ertepod.FindMetricsAddress(rtePod)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
metricsPort, err = e2ertepod.FindMetricsPort(rtePod)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
Expand All @@ -123,7 +123,7 @@ var _ = ginkgo.Describe("[RTE][Monitoring] metrics", func() {
}
rteContainerName, err := e2ertepod.FindRTEContainerName(rtePod)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
cmd := []string{"curl", "-v", "-k", "-L", fmt.Sprintf("https://%s:%d/metrics", MetricsAddress, metricsPort)}
cmd := []string{"curl", "-v", "-k", "-L", fmt.Sprintf("https://%s:%d/metrics", metricsAddress, metricsPort)}
key := client.ObjectKeyFromObject(rtePod)
klog.Infof("executing cmd: %s on pod %q", cmd, key.String())
var stdout, stderr []byte
Expand All @@ -142,7 +142,7 @@ var _ = ginkgo.Describe("[RTE][Monitoring] metrics", func() {
}
rteContainerName, err := e2ertepod.FindRTEContainerName(rtePod)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
cmd := []string{"curl", "-v", "-L", fmt.Sprintf("http://%s:%d/metrics", MetricsAddress, metricsPort)}
cmd := []string{"curl", "-v", "-L", fmt.Sprintf("http://%s:%d/metrics", metricsAddress, metricsPort)}
key := client.ObjectKeyFromObject(rtePod)
klog.Infof("executing cmd: %s on pod %q", cmd, key.String())
var stdout, stderr []byte
Expand Down Expand Up @@ -176,7 +176,7 @@ var _ = ginkgo.Describe("[RTE][Monitoring] metrics", func() {
rteContainerName, err := e2ertepod.FindRTEContainerName(rtePod)
gomega.Expect(err).ToNot(gomega.HaveOccurred())

cmd := []string{"curl", "-v", "-L", fmt.Sprintf("http://%s:%d/metrics", MetricsAddress, metricsPort)}
cmd := []string{"curl", "-v", "-L", fmt.Sprintf("http://%s:%d/metrics", metricsAddress, metricsPort)}
key := client.ObjectKeyFromObject(rtePod)
klog.Infof("executing cmd: %s on pod %q", cmd, key.String())
var stdout, stderr []byte
Expand Down

0 comments on commit 6a3fe8d

Please sign in to comment.