Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c86e1437
Commit
c86e1437
authored
Jun 02, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make fixture message more descriptive
+ use strip_heredoc to make the text in tests much more readable
parent
e21b1501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
db/fixtures/production/010_settings.rb
db/fixtures/production/010_settings.rb
+1
-1
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
+13
-12
No files found.
db/fixtures/production/010_settings.rb
View file @
c86e1437
...
...
@@ -24,6 +24,6 @@ if envs.any? {|env_name| ENV[env_name].present? }
if
ENV
[
'GITLAB_PROMETHEUS_METRICS_ENABLED'
].
present?
value
=
Gitlab
::
Utils
.
to_boolean
(
ENV
[
'GITLAB_PROMETHEUS_METRICS_ENABLED'
])
settings
.
prometheus_metrics_enabled
=
value
save
(
settings
,
'
GITLAB_PROMETHEUS_METRICS_ENABLED
'
)
save
(
settings
,
'
Prometheus metrics enabled flag
'
)
end
end
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
View file @
c86e1437
...
...
@@ -11,12 +11,13 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do
end
it
'marshal to text with non repeating type definition'
do
expected
=
<<-
EXPECTED
# TYPE metric1 gauge
metric1 1
# TYPE metric2 gauge
metric2 2
EXPECTED
expected
=
<<-
EXPECTED
.
strip_heredoc
# TYPE metric1 gauge
metric1 1
# TYPE metric2 gauge
metric2 2
EXPECTED
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
.
chomp
)
end
...
...
@@ -30,12 +31,12 @@ EXPECTED
end
it
'marshal to text with non repeating type definition'
do
expected
=
<<-
EXPECTED
# TYPE metric1 gauge
metric1 1
metric1 2
# TYPE metric2 gauge
metric2 3
expected
=
<<-
EXPECTED
.
strip_heredoc
# TYPE metric1 gauge
metric1 1
metric1 2
# TYPE metric2 gauge
metric2 3
EXPECTED
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
.
chomp
)
end
...
...
Write
Preview
Markdown
is supported
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