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
a717e856
Unverified
Commit
a717e856
authored
Nov 09, 2020
by
Emil Hessman
Committed by
GitHub
Nov 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: Rewrite test in GoConvey to stdlib and testify (#28918)
parent
d2ac7dc0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
pkg/services/sqlstore/playlist_test.go
+8
-13
No files found.
pkg/services/sqlstore/playlist_test.go
View file @
a717e856
...
...
@@ -5,41 +5,36 @@ package sqlstore
import
(
"testing"
.
"github.com/smartystreets/goconvey/convey"
"github.com/grafana/grafana/pkg/models"
"github.com/stretchr/testify/require"
)
func
TestPlaylistDataAccess
(
t
*
testing
.
T
)
{
Convey
(
"Testing Playlist data access"
,
t
,
func
()
{
InitTestDB
(
t
)
Convey
(
"Can create playlist"
,
func
(
)
{
t
.
Run
(
"Can create playlist"
,
func
(
t
*
testing
.
T
)
{
items
:=
[]
models
.
PlaylistItemDTO
{
{
Title
:
"graphite"
,
Value
:
"graphite"
,
Type
:
"dashboard_by_tag"
},
{
Title
:
"Backend response times"
,
Value
:
"3"
,
Type
:
"dashboard_by_id"
},
}
cmd
:=
models
.
CreatePlaylistCommand
{
Name
:
"NYC office"
,
Interval
:
"10m"
,
OrgId
:
1
,
Items
:
items
}
err
:=
CreatePlaylist
(
&
cmd
)
So
(
err
,
ShouldBeNil
)
require
.
NoError
(
t
,
err
)
Convey
(
"can update playlist"
,
func
(
)
{
t
.
Run
(
"Can update playlist"
,
func
(
t
*
testing
.
T
)
{
items
:=
[]
models
.
PlaylistItemDTO
{
{
Title
:
"influxdb"
,
Value
:
"influxdb"
,
Type
:
"dashboard_by_tag"
},
{
Title
:
"Backend response times"
,
Value
:
"2"
,
Type
:
"dashboard_by_id"
},
}
query
:=
models
.
UpdatePlaylistCommand
{
Name
:
"NYC office "
,
OrgId
:
1
,
Id
:
1
,
Interval
:
"10s"
,
Items
:
items
}
err
=
UpdatePlaylist
(
&
query
)
require
.
NoError
(
t
,
err
)
})
So
(
err
,
ShouldBeNil
)
Convey
(
"can remove playlist"
,
func
()
{
t
.
Run
(
"Can remove playlist"
,
func
(
t
*
testing
.
T
)
{
query
:=
models
.
DeletePlaylistCommand
{
Id
:
1
}
err
=
DeletePlaylist
(
&
query
)
So
(
err
,
ShouldBeNil
)
})
})
require
.
NoError
(
t
,
err
)
})
})
}
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