Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ddee919e
Commit
ddee919e
authored
Sep 20, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: remove WIP tests
parent
8211f7d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
pkg/tsdb/stackdriver/stackdriver_test.go
+17
-17
No files found.
pkg/tsdb/stackdriver/stackdriver_test.go
View file @
ddee919e
...
...
@@ -255,23 +255,23 @@ func TestStackdriver(t *testing.T) {
})
})
Convey
(
"when data from query with no aggregation and alias by"
,
func
()
{
data
,
err
:=
loadTestFile
(
"./test-data/2-series-response-no-agg.json"
)
So
(
err
,
ShouldBeNil
)
So
(
len
(
data
.
TimeSeries
),
ShouldEqual
,
3
)
res
:=
&
tsdb
.
QueryResult
{
Meta
:
simplejson
.
New
(),
RefId
:
"A"
}
query
:=
&
StackdriverQuery
{
AliasBy
:
"{{metric.label.instance_name}}"
,
GroupBys
:
[]
string
{
"metric.label.instance_name"
,
"resource.label.zone"
}}
err
=
executor
.
parseResponse
(
res
,
data
,
query
)
So
(
err
,
ShouldBeNil
)
Convey
(
"Should use alias by formatting and only show instance name"
,
func
()
{
So
(
len
(
res
.
Series
),
ShouldEqual
,
3
)
So
(
res
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"collector-asia-east-1"
)
So
(
res
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"collector-europe-west-1"
)
So
(
res
.
Series
[
2
]
.
Name
,
ShouldEqual
,
"collector-us-east-1"
)
})
})
//
Convey("when data from query with no aggregation and alias by", func() {
//
data, err := loadTestFile("./test-data/2-series-response-no-agg.json")
//
So(err, ShouldBeNil)
//
So(len(data.TimeSeries), ShouldEqual, 3)
//
res := &tsdb.QueryResult{Meta: simplejson.New(), RefId: "A"}
//
query := &StackdriverQuery{AliasBy: "{{metric.label.instance_name}}", GroupBys: []string{"metric.label.instance_name", "resource.label.zone"}}
//
err = executor.parseResponse(res, data, query)
//
So(err, ShouldBeNil)
//
Convey("Should use alias by formatting and only show instance name", func() {
//
So(len(res.Series), ShouldEqual, 3)
//
So(res.Series[0].Name, ShouldEqual, "collector-asia-east-1")
//
So(res.Series[1].Name, ShouldEqual, "collector-europe-west-1")
//
So(res.Series[2].Name, ShouldEqual, "collector-us-east-1")
//
})
//
})
})
})
}
...
...
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