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
fe8b842a
Commit
fe8b842a
authored
Sep 11, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Rails.root for CommonMetricsImporter
parent
b9ea4e35
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
db/importers/common_metrics_importer.rb
db/importers/common_metrics_importer.rb
+2
-2
spec/db/importers/common_metrics_importer_spec.rb
spec/db/importers/common_metrics_importer_spec.rb
+10
-0
No files found.
db/importers/common_metrics_importer.rb
View file @
fe8b842a
...
@@ -35,8 +35,8 @@ module Importers
...
@@ -35,8 +35,8 @@ module Importers
attr_reader
:content
attr_reader
:content
def
initialize
(
file
=
'config/prometheus/
common_metrics.yml'
)
def
initialize
(
file
name
=
'
common_metrics.yml'
)
@content
=
YAML
.
load_file
(
file
)
@content
=
YAML
.
load_file
(
Rails
.
root
.
join
(
'config'
,
'prometheus'
,
filename
)
)
end
end
def
execute
def
execute
...
...
spec/db/importers/common_metrics_importer_spec.rb
View file @
fe8b842a
...
@@ -47,6 +47,16 @@ describe Importers::CommonMetricsImporter do
...
@@ -47,6 +47,16 @@ describe Importers::CommonMetricsImporter do
end
end
end
end
context
"does import common_metrics.yml"
do
it
"when executed from outside of the Rails.root"
do
Dir
.
chdir
(
Dir
.
tmpdir
)
do
expect
{
subject
.
execute
}.
not_to
raise_error
end
expect
(
PrometheusMetric
.
common
).
not_to
be_empty
end
end
context
'does import properly all fields'
do
context
'does import properly all fields'
do
let
(
:query_identifier
)
{
'response-metric'
}
let
(
:query_identifier
)
{
'response-metric'
}
let
(
:group
)
do
let
(
:group
)
do
...
...
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