Skip to content

Commit

Permalink
adapt tests
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Nov 18, 2024
1 parent 7bd3d75 commit ac90f94
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions processor/k8sattributesprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestLoadConfig(t *testing.T) {
},
WaitForMetadataTimeout: 10 * time.Second,
},
disallowRegex: false,
},
{
id: component.NewIDWithName(metadata.Type, "3"),
Expand Down Expand Up @@ -155,6 +156,7 @@ func TestLoadConfig(t *testing.T) {
},
WaitForMetadataTimeout: 10 * time.Second,
},
disallowRegex: false,
},
{
id: component.NewIDWithName(metadata.Type, "too_many_sources"),
Expand Down Expand Up @@ -209,10 +211,10 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
if tt.disallowRegex {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
if !tt.disallowRegex {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
t.Cleanup(func() {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
})
}
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
Expand Down

0 comments on commit ac90f94

Please sign in to comment.