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
50d1519a
Commit
50d1519a
authored
May 30, 2018
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: mysql integration testing on ci.
parent
21ecaae6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
7 deletions
+32
-7
.circleci/config.yml
+26
-0
docker/blocks/mysql/docker-compose.yaml
+1
-1
docker/blocks/mysql_tests/Dockerfile
+2
-3
pkg/tsdb/mysql/mysql_test.go
+3
-3
No files found.
.circleci/config.yml
View file @
50d1519a
...
...
@@ -12,6 +12,26 @@ aliases:
version
:
2
jobs
:
mysql-integration-test
:
docker
:
-
image
:
circleci/golang:1.10
-
image
:
circleci/mysql:5.6-ram
environment
:
MYSQL_ROOT_PASSWORD
:
rootpass
MYSQL_DATABASE
:
grafana_tests
MYSQL_USER
:
grafana
MYSQL_PASSWORD
:
password
working_directory
:
/go/src/github.com/grafana/grafana
steps
:
-
checkout
-
run
:
sudo apt update
-
run
:
sudo apt install -y mysql-client
-
run
:
dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
-
run
:
cat docker/blocks/mysql_tests/setup.sql | mysql -h 127.0.0.1 -P 3306 -u root -prootpass
-
run
:
name
:
mysql integration tests
command
:
'
GRAFANA_TEST_DB=mysql
go
test
./pkg/...'
codespell
:
docker
:
-
image
:
circleci/python
...
...
@@ -188,6 +208,8 @@ workflows:
filters
:
*filter-not-release
-
test-backend
:
filters
:
*filter-not-release
-
mysql-integration-test
:
filters
:
*filter-not-release
-
deploy-master
:
requires
:
-
build-all
...
...
@@ -195,6 +217,7 @@ workflows:
-
test-frontend
-
codespell
-
gometalinter
-
mysql-integration-test
filters
:
branches
:
only
:
master
...
...
@@ -210,6 +233,8 @@ workflows:
filters
:
*filter-only-release
-
test-backend
:
filters
:
*filter-only-release
-
mysql-integration-test
:
filters
:
*filter-only-release
-
deploy-release
:
requires
:
-
build-all
...
...
@@ -217,4 +242,5 @@ workflows:
-
test-frontend
-
codespell
-
gometalinter
-
mysql-integration-test
filters
:
*filter-only-release
docker/blocks/mysql/docker-compose.yaml
View file @
50d1519a
mysql
:
image
:
mysql:
latest
image
:
mysql:
5.6
environment
:
MYSQL_ROOT_PASSWORD
:
rootpass
MYSQL_DATABASE
:
grafana
...
...
docker/blocks/mysql_tests/Dockerfile
View file @
50d1519a
FROM
mysql:
latest
FROM
mysql:
5.6
ADD
setup.sql /docker-entrypoint-initdb.d
CMD
["mysqld"]
\ No newline at end of file
CMD
["mysqld"]
pkg/tsdb/mysql/mysql_test.go
View file @
50d1519a
...
...
@@ -601,7 +601,7 @@ func TestMySQL(t *testing.T) {
Queries
:
[]
*
tsdb
.
Query
{
{
Model
:
simplejson
.
NewFromAny
(
map
[
string
]
interface
{}{
"rawSql"
:
`SELECT $__time(time), CONCAT(measurement, ' - value one') as metric, valueOne FROM metric_values ORDER BY 1`
,
"rawSql"
:
`SELECT $__time(time), CONCAT(measurement, ' - value one') as metric, valueOne FROM metric_values ORDER BY 1
,2
`
,
"format"
:
"time_series"
,
}),
RefId
:
"A"
,
...
...
@@ -615,8 +615,8 @@ func TestMySQL(t *testing.T) {
So
(
queryResult
.
Error
,
ShouldBeNil
)
So
(
len
(
queryResult
.
Series
),
ShouldEqual
,
2
)
So
(
queryResult
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"Metric
B
- value one"
)
So
(
queryResult
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"Metric
A
- value one"
)
So
(
queryResult
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"Metric
A
- value one"
)
So
(
queryResult
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"Metric
B
- value one"
)
})
Convey
(
"When doing a metric query grouping by time should return correct series"
,
func
()
{
...
...
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