Commit e33b17fa by Leonard Gram

build: integration testing postegres on ci.

parent 50d1519a
......@@ -32,6 +32,25 @@ jobs:
name: mysql integration tests
command: 'GRAFANA_TEST_DB=mysql go test ./pkg/...'
postgres-integration-test:
docker:
- image: circleci/golang:1.10
- image: circleci/postgres:9.3-ram
environment:
POSTGRES_USER: grafanatest
POSTGRES_PASSWORD: grafanatest
POSTGRES_DB: grafanatest
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run: sudo apt update
- run: sudo apt install -y postgresql-client
- run: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s
- run: 'PGPASSWORD=grafanatest psql -p 5432 -h 127.0.0.1 -U grafanatest -d grafanatest -f docker/blocks/postgres_tests/setup.sql'
- run:
name: postgres integration tests
command: 'GRAFANA_TEST_DB=postgres go test ./pkg/...'
codespell:
docker:
- image: circleci/python
......@@ -210,6 +229,8 @@ workflows:
filters: *filter-not-release
- mysql-integration-test:
filters: *filter-not-release
- postgres-integration-test:
filters: *filter-not-release
- deploy-master:
requires:
- build-all
......@@ -218,6 +239,7 @@ workflows:
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters:
branches:
only: master
......@@ -235,6 +257,8 @@ workflows:
filters: *filter-only-release
- mysql-integration-test:
filters: *filter-only-release
- postgres-integration-test:
filters: *filter-only-release
- deploy-release:
requires:
- build-all
......@@ -243,4 +267,5 @@ workflows:
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
postgrestest:
image: postgres:latest
image: postgres:9.3
environment:
POSTGRES_USER: grafana
POSTGRES_PASSWORD: password
......@@ -13,4 +13,4 @@
network_mode: bridge
environment:
FD_DATASOURCE: postgres
FD_PORT: 5432
\ No newline at end of file
FD_PORT: 5432
FROM postgres:latest
FROM postgres:9.3
ADD setup.sql /docker-entrypoint-initdb.d
CMD ["postgres"]
\ No newline at end of file
CMD ["postgres"]
CREATE DATABASE grafanadstest;
REVOKE CONNECT ON DATABASE grafanadstest FROM PUBLIC;
GRANT CONNECT ON DATABASE grafanadstest TO grafanatest;
\ No newline at end of file
GRANT CONNECT ON DATABASE grafanadstest TO grafanatest;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment