Skip to content

Commit

Permalink
Check if metrics and logs are found
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFairise2 committed Aug 1, 2024
1 parent 788d3d1 commit b73f095
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions e2e-tests/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"fmt"
"os"
"testing"
"time"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner"
otelcollector "github.com/DataDog/opentelemetry-collector-contrib/e2e-tests/otel-collector"
Expand Down Expand Up @@ -58,16 +59,19 @@ func (v *otelSuite) TestExecute() {
for _, pod := range res.Items {
v.T().Logf("Pod: %s", pod.Name)
}
va, err := v.Env().FakeIntake.Client().GetMetricNames()
assert.NoError(v.T(), err)
fmt.Printf("metriiiics: %v", va)
lo, err := v.Env().FakeIntake.Client().FilterLogs("")
for _, l := range lo {
fmt.Printf("logs : %v", l.Tags)
}
assert.EventuallyWithT(v.T(), func(t *assert.CollectT) {
metricsName, err := v.Env().FakeIntake.Client().GetMetricNames()
assert.NoError(v.T(), err)
fmt.Printf("metriiiics: %v", metricsName)
logs, err := v.Env().FakeIntake.Client().FilterLogs("")
for _, l := range logs {
fmt.Printf("logs : %v", l.Tags)
}

assert.NoError(v.T(), err)
assert.NotEmpty(v.T(), metricsName)
assert.NotEmpty(v.T(), logs)

assert.NoError(v.T(), err)
fmt.Printf("logs: %v", lo)
}, 1*time.Minute, 10*time.Second)

assert.Equal(v.T(), 1, len(res.Items))
}

0 comments on commit b73f095

Please sign in to comment.