Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
taniyourstruly committed Aug 13, 2024
1 parent 59f50c1 commit a1d71f2
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions apis/v1beta1/collector_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ var (
testScheme = scheme.Scheme
)

var cfgYaml = `receivers:
examplereceiver:
endpoint: "0.0.0.0:12345"
examplereceiver/settings:
endpoint: "0.0.0.0:12346"
prometheus:
config:
scrape_configs:
- job_name: otel-collector
scrape_interval: 10s
jaeger/custom:
protocols:
thrift_http:
endpoint: 0.0.0.0:15268
`

func TestValidate(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -538,6 +522,22 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
}
}

var cfgYaml = `receivers:
examplereceiver:
endpoint: "0.0.0.0:12345"
examplereceiver/settings:
endpoint: "0.0.0.0:12346"
prometheus:
config:
scrape_configs:
- job_name: otel-collector
scrape_interval: 10s
jaeger/custom:
protocols:
thrift_http:
endpoint: 0.0.0.0:15268
`

func TestOTELColValidatingWebhook(t *testing.T) {
minusOne := int32(-1)
zero := int32(0)
Expand All @@ -546,11 +546,6 @@ func TestOTELColValidatingWebhook(t *testing.T) {
three := int32(3)
five := int32(5)

if err := v1beta1.AddToScheme(testScheme); err != nil {
fmt.Printf("failed to register scheme: %v", err)
os.Exit(1)
}

cfg := v1beta1.Config{}
err := yaml.Unmarshal([]byte(cfgYaml), &cfg)
require.NoError(t, err)
Expand Down

0 comments on commit a1d71f2

Please sign in to comment.