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
7e434fc0
Commit
7e434fc0
authored
Sep 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: moved graphite specs into plugins directory
parent
cb7424ce
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
44 deletions
+44
-44
karma.conf.js
+1
-0
public/app/plugins/datasource/graphite/add_graphite_func.js
+0
-0
public/app/plugins/datasource/graphite/datasource.js
+3
-3
public/app/plugins/datasource/graphite/func_editor.js
+0
-0
public/app/plugins/datasource/graphite/query_ctrl.js
+0
-0
public/app/plugins/datasource/graphite/specs/datasource_specs.ts
+7
-9
public/app/plugins/datasource/graphite/specs/gfunc_specs.ts
+13
-16
public/app/plugins/datasource/graphite/specs/query_ctrl_specs.ts
+13
-14
public/test/lib/common.ts
+6
-1
public/test/test-main.js
+1
-1
No files found.
karma.conf.js
View file @
7e434fc0
...
@@ -25,6 +25,7 @@ module.exports = function(config) {
...
@@ -25,6 +25,7 @@ module.exports = function(config) {
browsers
:
[
'PhantomJS'
],
browsers
:
[
'PhantomJS'
],
captureTimeout
:
60000
,
captureTimeout
:
60000
,
singleRun
:
true
,
singleRun
:
true
,
autoWatchBatchDelay
:
1000
,
});
});
...
...
public/app/plugins/datasource/graphite/add
GraphiteF
unc.js
→
public/app/plugins/datasource/graphite/add
_graphite_f
unc.js
View file @
7e434fc0
File moved
public/app/plugins/datasource/graphite/datasource.js
View file @
7e434fc0
...
@@ -5,9 +5,9 @@ define([
...
@@ -5,9 +5,9 @@ define([
'config'
,
'config'
,
'app/core/utils/datemath'
,
'app/core/utils/datemath'
,
'./directives'
,
'./directives'
,
'./query
C
trl'
,
'./query
_c
trl'
,
'./func
E
ditor'
,
'./func
_e
ditor'
,
'./add
GraphiteF
unc'
,
'./add
_graphite_f
unc'
,
],
],
function
(
angular
,
_
,
$
,
config
,
dateMath
)
{
function
(
angular
,
_
,
$
,
config
,
dateMath
)
{
'use strict'
;
'use strict'
;
...
...
public/app/plugins/datasource/graphite/func
E
ditor.js
→
public/app/plugins/datasource/graphite/func
_e
ditor.js
View file @
7e434fc0
File moved
public/app/plugins/datasource/graphite/query
C
trl.js
→
public/app/plugins/datasource/graphite/query
_c
trl.js
View file @
7e434fc0
File moved
public/
test/specs/graphiteDatasource-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/datasource_specs.t
s
View file @
7e434fc0
define
([
///<amd-dependency path="app/plugins/datasource/graphite/datasource" />
'./helpers'
,
///<amd-dependency path="test/specs/helpers" name="helpers" />
'app/plugins/datasource/graphite/datasource'
],
function
(
helpers
)
{
'use strict'
;
describe
(
'graphiteDatasource'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
declare
var
helpers
:
any
;
describe
(
'graphiteDatasource'
,
function
()
{
var
ctx
=
new
helpers
.
ServiceTestContext
();
var
ctx
=
new
helpers
.
ServiceTestContext
();
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
([
'backendSrv'
]));
beforeEach
(
ctx
.
providePhase
([
'backendSrv'
]));
beforeEach
(
ctx
.
createService
(
'GraphiteDatasource'
));
beforeEach
(
ctx
.
createService
(
'GraphiteDatasource'
));
...
@@ -116,7 +116,5 @@ define([
...
@@ -116,7 +116,5 @@ define([
});
});
});
});
});
public/
test/specs/gfunc-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/gfunc_specs.t
s
View file @
7e434fc0
define
([
///<amd-dependency path="app/plugins/datasource/graphite/gfunc" name="gfunc" />
'app/plugins/datasource/graphite/gfunc'
],
function
(
gfunc
)
{
'use strict'
;
describe
(
'when creating func instance from func names'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
declare
var
gfunc
:
any
;
describe
(
'when creating func instance from func names'
,
function
()
{
it
(
'should return func instance'
,
function
()
{
it
(
'should return func instance'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
expect
(
func
).
to
.
be
.
ok
();
expect
(
func
).
to
.
be
.
ok
();
...
@@ -31,10 +31,9 @@ define([
...
@@ -31,10 +31,9 @@ define([
func
.
updateText
();
func
.
updateText
();
expect
(
func
.
text
).
to
.
equal
(
"groupByNode(5, avg)"
);
expect
(
func
.
text
).
to
.
equal
(
"groupByNode(5, avg)"
);
});
});
});
});
describe
(
'when rendering func instance'
,
function
()
{
describe
(
'when rendering func instance'
,
function
()
{
it
(
'should handle single metric param'
,
function
()
{
it
(
'should handle single metric param'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
...
@@ -77,16 +76,16 @@ define([
...
@@ -77,16 +76,16 @@ define([
expect
(
func
.
render
(
'#A'
)).
to
.
equal
(
"asPercent(#A, #B)"
);
expect
(
func
.
render
(
'#A'
)).
to
.
equal
(
"asPercent(#A, #B)"
);
});
});
});
});
describe
(
'when requesting function categories'
,
function
()
{
describe
(
'when requesting function categories'
,
function
()
{
it
(
'should return function categories'
,
function
()
{
it
(
'should return function categories'
,
function
()
{
var
catIndex
=
gfunc
.
getCategories
();
var
catIndex
=
gfunc
.
getCategories
();
expect
(
catIndex
.
Special
.
length
).
to
.
be
.
greaterThan
(
8
);
expect
(
catIndex
.
Special
.
length
).
to
.
be
.
greaterThan
(
8
);
});
});
});
});
describe
(
'when updating func param'
,
function
()
{
describe
(
'when updating func param'
,
function
()
{
it
(
'should update param value and update text representation'
,
function
()
{
it
(
'should update param value and update text representation'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'summarize'
,
{
withDefaultParams
:
true
});
var
func
=
gfunc
.
createFuncInstance
(
'summarize'
,
{
withDefaultParams
:
true
});
func
.
updateParam
(
'1h'
,
0
);
func
.
updateParam
(
'1h'
,
0
);
...
@@ -99,9 +98,9 @@ define([
...
@@ -99,9 +98,9 @@ define([
func
.
updateParam
(
'0.001'
,
0
);
func
.
updateParam
(
'0.001'
,
0
);
expect
(
func
.
params
[
0
]).
to
.
be
(
'0.001'
);
expect
(
func
.
params
[
0
]).
to
.
be
(
'0.001'
);
});
});
});
});
describe
(
'when updating func param with optional second parameter'
,
function
()
{
describe
(
'when updating func param with optional second parameter'
,
function
()
{
it
(
'should update value and text'
,
function
()
{
it
(
'should update value and text'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'aliasByNode'
);
var
func
=
gfunc
.
createFuncInstance
(
'aliasByNode'
);
func
.
updateParam
(
'1'
,
0
);
func
.
updateParam
(
'1'
,
0
);
...
@@ -124,7 +123,5 @@ define([
...
@@ -124,7 +123,5 @@ define([
expect
(
func
.
params
[
1
]).
to
.
be
(
undefined
);
expect
(
func
.
params
[
1
]).
to
.
be
(
undefined
);
expect
(
func
.
text
).
to
.
be
(
'aliasByNode(4)'
);
expect
(
func
.
text
).
to
.
be
(
'aliasByNode(4)'
);
});
});
});
});
});
public/
test/specs/graphiteTargetCtrl-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/query_ctrl_specs.t
s
View file @
7e434fc0
define
([
///<amd-dependency path="app/plugins/datasource/graphite/gfunc" name="gfunc"/>
'./helpers'
,
///<amd-dependency path="app/plugins/datasource/graphite/query_ctrl" />
'app/plugins/datasource/graphite/gfunc'
,
///<amd-dependency path="app/services/uiSegmentSrv" />
'app/plugins/datasource/graphite/queryCtrl'
,
///<amd-dependency path="test/specs/helpers" name="helpers" />
'app/services/uiSegmentSrv'
],
function
(
helpers
,
gfunc
)
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
'use strict'
;
declare
var
gfunc
:
any
;
describe
(
'GraphiteQueryCtrl'
,
function
()
{
declare
var
helpers
:
any
;
describe
(
'GraphiteQueryCtrl'
,
function
()
{
var
ctx
=
new
helpers
.
ControllerTestContext
();
var
ctx
=
new
helpers
.
ControllerTestContext
();
beforeEach
(
module
(
'grafana.controllers'
));
beforeEach
(
angularMocks
.
module
(
'grafana.controllers'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
createControllerPhase
(
'GraphiteQueryCtrl'
));
beforeEach
(
ctx
.
createControllerPhase
(
'GraphiteQueryCtrl'
));
...
@@ -173,7 +175,4 @@ define([
...
@@ -173,7 +175,4 @@ define([
expect
(
ctx
.
scope
.
$parent
.
get_data
.
called
).
to
.
be
(
true
);
expect
(
ctx
.
scope
.
$parent
.
get_data
.
called
).
to
.
be
(
true
);
});
});
});
});
});
});
});
public/test/lib/common.ts
View file @
7e434fc0
...
@@ -7,10 +7,15 @@ var it = _global.it;
...
@@ -7,10 +7,15 @@ var it = _global.it;
var
sinon
=
_global
.
sinon
;
var
sinon
=
_global
.
sinon
;
var
expect
=
_global
.
expect
;
var
expect
=
_global
.
expect
;
var
angularMocks
=
{
module
:
_global
.
module
,
};
export
{
export
{
beforeEach
,
beforeEach
,
describe
,
describe
,
it
,
it
,
sinon
,
sinon
,
expect
expect
,
angularMocks
,
}
}
public/test/test-main.js
View file @
7e434fc0
...
@@ -113,7 +113,7 @@ require([
...
@@ -113,7 +113,7 @@ require([
var
specs
=
[];
var
specs
=
[];
for
(
var
file
in
window
.
__karma__
.
files
)
{
for
(
var
file
in
window
.
__karma__
.
files
)
{
if
(
/
base
\/
test
\/
specs.*/
.
test
(
file
))
{
if
(
/specs.*/
.
test
(
file
))
{
file
=
file2moduleName
(
file
);
file
=
file2moduleName
(
file
);
specs
.
push
(
file
);
specs
.
push
(
file
);
}
}
...
...
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