Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] make update-otel #24661

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix unit tests
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed Jul 28, 2023
commit 827a6b92e39fb7124236a2761954682f9037dc79
3 changes: 2 additions & 1 deletion receiver/mongodbreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func TestBadTLSConfigs(t *testing.T) {
Endpoint: "localhost:27017",
},
},
TLSClientSetting: tc.tlsConfig,
ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type),
TLSClientSetting: tc.tlsConfig,
}
err := component.ValidateConfig(cfg)
if tc.expectError {
Expand Down
2 changes: 2 additions & 0 deletions receiver/podmanreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestLoadConfig(t *testing.T) {
ScraperControllerSettings: scraperhelper.ScraperControllerSettings{
CollectionInterval: 10 * time.Second,
InitialDelay: time.Second,
Timeout: 5 * time.Second,
},
APIVersion: defaultAPIVersion,
Endpoint: "unix:https:///run/podman/podman.sock",
Expand All @@ -46,6 +47,7 @@ func TestLoadConfig(t *testing.T) {
ScraperControllerSettings: scraperhelper.ScraperControllerSettings{
CollectionInterval: 2 * time.Second,
InitialDelay: time.Second,
Timeout: 20 * time.Second,
},
APIVersion: defaultAPIVersion,
Endpoint: "http:https://example.com/",
Expand Down
10 changes: 5 additions & 5 deletions receiver/windowsperfcountersreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

const (
negativeCollectionIntervalErr = "collection_interval must be a positive duration"
negativeCollectionIntervalErr = "\"collection_interval\": requires positive value"
noPerfCountersErr = "must specify at least one perf counter"
noObjectNameErr = "must specify object name for all perf counters"
noCountersErr = `perf counter for object "%s" does not specify any counters`
Expand Down Expand Up @@ -181,7 +181,7 @@ func TestLoadConfig(t *testing.T) {
},
{
id: component.NewIDWithName(metadata.Type, "negative-collection-interval"),
expectedErr: negativeCollectionIntervalErr,
expectedErr: fmt.Sprintf("collection_interval must be a positive duration; %s", negativeCollectionIntervalErr),
},
{
id: component.NewIDWithName(metadata.Type, "noperfcounters"),
Expand All @@ -198,11 +198,11 @@ func TestLoadConfig(t *testing.T) {
{
id: component.NewIDWithName(metadata.Type, "allerrors"),
expectedErr: fmt.Sprintf(
"%s; %s; %s; %s",
negativeCollectionIntervalErr,
"collection_interval must be a positive duration; %s; %s; %s; %s",
fmt.Sprintf(noCountersErr, "object"),
fmt.Sprintf(emptyInstanceErr, "object"),
noObjectNameErr,
negativeCollectionIntervalErr,
),
},
{
Expand All @@ -221,7 +221,7 @@ func TestLoadConfig(t *testing.T) {
require.NoError(t, component.UnmarshalConfig(sub, cfg))

if tt.expectedErr != "" {
assert.Equal(t, component.ValidateConfig(cfg).Error(), tt.expectedErr)
assert.Equal(t, tt.expectedErr, component.ValidateConfig(cfg).Error())
return
}
assert.NoError(t, component.ValidateConfig(cfg))
Expand Down
Loading