@@ -81,9 +81,10 @@ var baseProviderMock = providerMock{
81
81
}
82
82
83
83
var testCases = []struct {
84
- name string
85
- goldenDir string
86
- context ContextID
84
+ name string
85
+ goldenDir string
86
+ context ContextID
87
+ attributes []attribute.Key
87
88
}{
88
89
{
89
90
name : "default source.address attribute, not found" ,
@@ -121,9 +122,10 @@ var testCases = []struct {
121
122
context : record ,
122
123
},
123
124
{
124
- name : "custom address located in the record attributes" ,
125
- goldenDir : "record_custom_address" ,
126
- context : record ,
125
+ name : "custom address located in the record attributes" ,
126
+ goldenDir : "record_custom_address" ,
127
+ context : record ,
128
+ attributes : []attribute.Key {"source.address" , "client.address" , "custom.address" },
127
129
},
128
130
}
129
131
@@ -221,7 +223,11 @@ func TestProcessor(t *testing.T) {
221
223
222
224
for _ , tt := range testCases {
223
225
t .Run (tt .name , func (t * testing.T ) {
224
- cfg := & Config {Context : tt .context , Providers : map [string ]provider.Config {providerKey : & providerConfigMock {}}, Attributes : []attribute.Key {"source.address" , "client.address" , "custom.address" }}
226
+ var attributes []attribute.Key = defaultAttributes
227
+ if tt .attributes != nil {
228
+ attributes = tt .attributes
229
+ }
230
+ cfg := & Config {Context : tt .context , Providers : map [string ]provider.Config {providerKey : & providerConfigMock {}}, Attributes : attributes }
225
231
compareAllSignals (cfg , tt .goldenDir )(t )
226
232
})
227
233
}
0 commit comments