You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2024/10/12 07:03:12 UTC
(camel-k) 04/04: fix(test): Fix telemetry tests
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 17f87953255f156aaeb5470b69b08011c90ab613
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Fri Oct 11 11:27:48 2024 +0200
fix(test): Fix telemetry tests
---
e2e/telemetry/telemetry_test.go | 8 ++++----
pkg/trait/telemetry.go | 4 +++-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/e2e/telemetry/telemetry_test.go b/e2e/telemetry/telemetry_test.go
index 0c8ba28da..8513ca25d 100644
--- a/e2e/telemetry/telemetry_test.go
+++ b/e2e/telemetry/telemetry_test.go
@@ -62,8 +62,8 @@ func TestTelemetryTrait(t *testing.T) {
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)))
+ g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("url.path: Str(/customers/%s)", name)))
+ g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring("http.route: Str(/customers/:name)"))
})
}
@@ -94,7 +94,7 @@ func TestTelemetryAddon(t *testing.T) {
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)))
+ g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("url.path: Str(/customers/%s)", name)))
+ g.Eventually(TailedLogs(t, ctx, pod.Namespace, pod.Name, 100), TestTimeoutLong).Should(ContainSubstring("http.route: Str(/customers/:name)"))
})
}
diff --git a/pkg/trait/telemetry.go b/pkg/trait/telemetry.go
index a8ce6d5d4..c6be72574 100644
--- a/pkg/trait/telemetry.go
+++ b/pkg/trait/telemetry.go
@@ -127,7 +127,9 @@ func (t *telemetryTrait) Apply(e *Environment) error {
if e.CamelCatalog.CamelCatalogSpec.Runtime.Provider == v1.RuntimeProviderQuarkus &&
e.CamelCatalog.CamelCatalogSpec.Runtime.Version == "3.15.0" {
t.setRuntimeProviderQuarkus315Properties(e)
- } else if e.CamelCatalog.Runtime.Capabilities["telemetry"].RuntimeProperties != nil {
+ return nil
+ }
+ if e.CamelCatalog.Runtime.Capabilities["telemetry"].RuntimeProperties != nil {
t.setCatalogConfiguration(e)
} else {
t.setRuntimeProviderProperties(e)