Skip to content

Commit

Permalink
[TO REMOVE] Check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Sep 4, 2024
1 parent 84750ad commit 1c36a37
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions e2e/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,33 +66,3 @@ func TestTelemetryTrait(t *testing.T) {
g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("http.url: Str(http://%s/customers/%s)", serviceName, name)))
})
}

func TestTelemetryAddon(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
// Check service is available
g.Eventually(ServicesByType(t, ctx, "otlp", corev1.ServiceTypeClusterIP), TestTimeoutLong).ShouldNot(BeEmpty())

// Create integration and activate traces by telemetry trait
ExpectExecSucceed(t, g, Kubectl("apply", "-f", "files/int-rest-consumer-addon.yaml", "-n", ns))
g.Eventually(IntegrationPodPhase(t, ctx, ns, "rest-consumer-addon"), TestTimeoutLong).Should(Equal(corev1.PodRunning))

name := "Alice"
serviceName := fmt.Sprintf("rest-consumer-addon.%s", ns)
g.Expect(KamelRun(t, ctx, ns, "files/rest-producer.yaml",
"-p", fmt.Sprintf("serviceName=%s", serviceName),
"-p", "name="+name,
"--name", "rest-producer").Execute()).To(Succeed())
g.Eventually(IntegrationPodPhase(t, ctx, ns, "rest-producer"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationLogs(t, ctx, ns, "rest-consumer-addon"), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("get %s", name)))
g.Eventually(IntegrationLogs(t, ctx, ns, "rest-producer"), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("%s Doe", name)))

// Find opentelemetry collector pod : the exporter is configured to log traces with detailed verbosity.
pod, err := Pod(t, ctx, "otlp", "opentelemetrycollector")()
g.Expect(err).To(BeNil())
g.Expect(pod).NotTo(BeNil())

// Ensured logs in opentelemetry collector pod are present
g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("http.target: Str(/customers/%s)", name)))
g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("http.url: Str(http://%s/customers/%s)", serviceName, name)))
})
}

0 comments on commit 1c36a37

Please sign in to comment.