Skip to content

Commit

Permalink
fix traces tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CircleCI committed Dec 22, 2024
1 parent d17286c commit 5b96457
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions tests/kubernetes-distros/kind/lumigooperator_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func TestLumigoOperatorTraces(t *testing.T) {

deploymentName := "app"
cronJobName := "load-generator"
namespaceName := envconf.RandomName("test-ns", 12)

testAppDeploymentFeature := features.New("TestApp").
Setup(func(ctx context.Context, t *testing.T, config *envconf.Config) context.Context {
namespaceName := envconf.RandomName(ctx.Value(internal.ContextTestAppNamespacePrefix).(string), 12)
Setup(func(ctx context.Context, t *testing.T, config *envconf.Config) context.Context {
testJsAppClientImage := ctx.Value(internal.ContextTestAppJsClientImageName).(string)
testJsAppServerImage := ctx.Value(internal.ContextTestAppJsServerImageName).(string)

Expand Down Expand Up @@ -242,7 +242,6 @@ func TestLumigoOperatorTraces(t *testing.T) {
return ctx
}).
Assess("CronJob traces have the 'k8s.cronjob.id' resource attribute set", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
namespaceName := envconf.RandomName(ctx.Value(internal.ContextTestAppNamespacePrefix).(string), 12)
otlpSinkDataPath := ctx.Value(internal.ContextKeyOtlpSinkDataPath).(string)

tracesPath := filepath.Join(otlpSinkDataPath, "traces.json")
Expand Down Expand Up @@ -313,7 +312,6 @@ func TestLumigoOperatorTraces(t *testing.T) {
return ctx
}).
Assess("Deployment traces have the 'k8s.deployment.uid' resource attribute set", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
namespaceName := envconf.RandomName(ctx.Value(internal.ContextTestAppNamespacePrefix).(string), 12)
otlpSinkDataPath := ctx.Value(internal.ContextKeyOtlpSinkDataPath).(string)

tracesPath := filepath.Join(otlpSinkDataPath, "traces.json")
Expand Down Expand Up @@ -556,7 +554,6 @@ func TestLumigoOperatorTraces(t *testing.T) {
return ctx
}).
Assess("LUMIGO_ENABLE_TRACES reflects spec.tracing.enabled", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
namespaceName := envconf.RandomName(ctx.Value(internal.ContextTestAppNamespacePrefix).(string), 12)
if err := apimachinerywait.PollImmediateUntilWithContext(
ctx,
time.Second*5,
Expand Down
2 changes: 1 addition & 1 deletion tests/kubernetes-distros/kind/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func TestMain(m *testing.M) {
ctx = context.WithValue(ctx, internal.ContextTestAppPythonImageName, testPythonImageName)
ctx = context.WithValue(ctx, internal.ContextTestAppBusyboxIncludedContainerNamePrefix, "busybox-included")
ctx = context.WithValue(ctx, internal.ContextTestAppBusyboxExcludedContainerNamePrefix, "busybox-excluded")
ctx = context.WithValue(ctx, internal.ContextTestAppNamespacePrefix, "test-ns")
ctx = context.WithValue(ctx, internal.ContextTestAppNamespacePrefix, "test-logs-ns")

testEnv = env.NewWithConfig(cfg).WithContext(ctx)

Expand Down

0 comments on commit 5b96457

Please sign in to comment.