Skip to content

Commit

Permalink
add labels to test
Browse files Browse the repository at this point in the history
  • Loading branch information
aphralG committed Jan 20, 2025
1 parent da0e1df commit c157cd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 6 additions & 5 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestLoadPropertiesFromFile(t *testing.T) {
require.NoError(t, err)

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

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

Expand Down Expand Up @@ -772,7 +772,6 @@ func createConfig() *Config {
Server: &ServerConfig{
Host: "127.0.0.1",
Port: 5643,
Type: 0,
},
Authenticator: "test-saas-token",
TLS: &TLSConfig{
Expand All @@ -788,7 +787,6 @@ func createConfig() *Config {
Server: &ServerConfig{
Host: "127.0.0.1",
Port: 1235,
Type: 0,
},
TLS: &TLSConfig{
Cert: "/path/to/server-cert.pem",
Expand Down Expand Up @@ -822,7 +820,6 @@ func createConfig() *Config {
Server: &ServerConfig{
Host: "127.0.0.1",
Port: 4317,
Type: 0,
},
Auth: &AuthConfig{
Token: "secret-receiver-token",
Expand Down Expand Up @@ -872,7 +869,6 @@ func createConfig() *Config {
Server: &ServerConfig{
Host: "127.0.0.1",
Port: 1337,
Type: 0,
},
TLS: &TLSConfig{
Cert: "/path/to/server-cert.pem",
Expand Down Expand Up @@ -926,5 +922,10 @@ func createConfig() *Config {
MonitoringFrequency: 10 * time.Second,
},
},
Labels: map[string]any{
"label1": "label 1",
"label2": "new-value",
"label3": 123,
},
}
}
10 changes: 6 additions & 4 deletions internal/config/testdata/nginx-agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ watchers:
file_watcher:
monitoring_frequency: 10s

labels:
label1: label 1
label2: new-value
label3: 123

data_plane_config:
nginx:
reload_monitoring_period: 30s
Expand Down Expand Up @@ -46,7 +51,7 @@ command:
server:
host: "127.0.0.1"
port: 8888
type: 0
type: grpc
auth:
token: "1234"
tls:
Expand All @@ -63,7 +68,6 @@ collector:
- server:
host: "127.0.0.1"
port: 4317
type: 0
auth:
Token: "secret-receiver-token"
tls:
Expand Down Expand Up @@ -111,7 +115,6 @@ collector:
server:
host: "127.0.0.1"
port: 1235
type: 0
tls:
server_name: "test-server"
skip_verify: false
Expand All @@ -129,7 +132,6 @@ collector:
server:
host: "127.0.0.1"
port: 1337
type: 0
path: "/test"
tls:
server_name: "server-name"
Expand Down

0 comments on commit c157cd6

Please sign in to comment.