Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
19c260a4
Unverified
Commit
19c260a4
authored
6 years ago
by
Nick Ethier
Browse files
Options
Download
Email Patches
Plain Diff
command/agent: additional tests for telemetry config parsing
parent
825c2ffc
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
command/agent/config_test.go
+25
-0
command/agent/config_test.go
with
25 additions
and
0 deletions
+25
-0
command/agent/config_test.go
+
25
-
0
View file @
19c260a4
...
...
@@ -227,6 +227,8 @@ func TestConfig_Merge(t *testing.T) {
CirconusBrokerID
:
"1"
,
CirconusBrokerSelectTag
:
"dc:dc2"
,
PrefixFilter
:
[]
string
{
"prefix1"
,
"prefix2"
},
DisableDispatchedJobSummaryMetrics
:
true
,
FilterDefault
:
helper
.
BoolToPtr
(
false
),
},
Client
:
&
ClientConfig
{
Enabled
:
true
,
...
...
@@ -1034,3 +1036,26 @@ func TestTelemetry_PrefixFilters(t *testing.T) {
})
}
}
func
TestTelemetry_Parse
(
t
*
testing
.
T
)
{
require
:=
require
.
New
(
t
)
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"nomad"
)
require
.
NoError
(
err
)
defer
os
.
RemoveAll
(
dir
)
file1
:=
filepath
.
Join
(
dir
,
"config1.hcl"
)
err
=
ioutil
.
WriteFile
(
file1
,
[]
byte
(
`telemetry{
prefix_filter = ["+nomad.raft"]
filter_default = false
disable_dispatched_job_summary_metrics = true
}`
),
0600
)
require
.
NoError
(
err
)
// Works on config dir
config
,
err
:=
LoadConfig
(
dir
)
require
.
NoError
(
err
)
require
.
False
(
*
config
.
Telemetry
.
FilterDefault
)
require
.
Exactly
([]
string
{
"+nomad.raft"
},
config
.
Telemetry
.
PrefixFilter
)
require
.
True
(
config
.
Telemetry
.
DisableDispatchedJobSummaryMetrics
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help