Skip to content

Commit c157cd6

Browse files
committed
add labels to test
1 parent da0e1df commit c157cd6

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

internal/config/config_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestLoadPropertiesFromFile(t *testing.T) {
132132
require.NoError(t, err)
133133

134134
assert.Equal(t, "debug", viperInstance.GetString(LogLevelKey))
135-
assert.Equal(t, "./", viperInstance.GetString(LogPathKey))
135+
assert.Equal(t, "./test-path", viperInstance.GetString(LogPathKey))
136136

137137
assert.Equal(t, 15*time.Second, viperInstance.GetDuration(ClientKeepAliveTimeoutKey))
138138

@@ -772,7 +772,6 @@ func createConfig() *Config {
772772
Server: &ServerConfig{
773773
Host: "127.0.0.1",
774774
Port: 5643,
775-
Type: 0,
776775
},
777776
Authenticator: "test-saas-token",
778777
TLS: &TLSConfig{
@@ -788,7 +787,6 @@ func createConfig() *Config {
788787
Server: &ServerConfig{
789788
Host: "127.0.0.1",
790789
Port: 1235,
791-
Type: 0,
792790
},
793791
TLS: &TLSConfig{
794792
Cert: "/path/to/server-cert.pem",
@@ -822,7 +820,6 @@ func createConfig() *Config {
822820
Server: &ServerConfig{
823821
Host: "127.0.0.1",
824822
Port: 4317,
825-
Type: 0,
826823
},
827824
Auth: &AuthConfig{
828825
Token: "secret-receiver-token",
@@ -872,7 +869,6 @@ func createConfig() *Config {
872869
Server: &ServerConfig{
873870
Host: "127.0.0.1",
874871
Port: 1337,
875-
Type: 0,
876872
},
877873
TLS: &TLSConfig{
878874
Cert: "/path/to/server-cert.pem",
@@ -926,5 +922,10 @@ func createConfig() *Config {
926922
MonitoringFrequency: 10 * time.Second,
927923
},
928924
},
925+
Labels: map[string]any{
926+
"label1": "label 1",
927+
"label2": "new-value",
928+
"label3": 123,
929+
},
929930
}
930931
}

internal/config/testdata/nginx-agent.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ watchers:
1010
file_watcher:
1111
monitoring_frequency: 10s
1212

13+
labels:
14+
label1: label 1
15+
label2: new-value
16+
label3: 123
17+
1318
data_plane_config:
1419
nginx:
1520
reload_monitoring_period: 30s
@@ -46,7 +51,7 @@ command:
4651
server:
4752
host: "127.0.0.1"
4853
port: 8888
49-
type: 0
54+
type: grpc
5055
auth:
5156
token: "1234"
5257
tls:
@@ -63,7 +68,6 @@ collector:
6368
- server:
6469
host: "127.0.0.1"
6570
port: 4317
66-
type: 0
6771
auth:
6872
Token: "secret-receiver-token"
6973
tls:
@@ -111,7 +115,6 @@ collector:
111115
server:
112116
host: "127.0.0.1"
113117
port: 1235
114-
type: 0
115118
tls:
116119
server_name: "test-server"
117120
skip_verify: false
@@ -129,7 +132,6 @@ collector:
129132
server:
130133
host: "127.0.0.1"
131134
port: 1337
132-
type: 0
133135
path: "/test"
134136
tls:
135137
server_name: "server-name"

0 commit comments

Comments
 (0)