Merge pull request #12 from antonlindstrom/feature/travisci
Update tests to use TravisCI
This commit is contained in:
10
.drone.yml
10
.drone.yml
@@ -1,10 +0,0 @@
|
|||||||
image: go1.2
|
|
||||||
env:
|
|
||||||
- GOPATH=/var/cache/drone
|
|
||||||
services:
|
|
||||||
- postgres
|
|
||||||
script:
|
|
||||||
- export PGSTORE_TEST_CONN="postgres://postgres@127.0.0.1/test?sslmode=disable"
|
|
||||||
- psql -c 'create database test;' -U postgres -h 127.0.0.1
|
|
||||||
- make
|
|
||||||
- make test
|
|
18
.travis.yml
Normal file
18
.travis.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
language: go
|
||||||
|
|
||||||
|
go:
|
||||||
|
- 1.2
|
||||||
|
- tip
|
||||||
|
|
||||||
|
script: make test
|
||||||
|
|
||||||
|
env:
|
||||||
|
- PGSTORE_TEST_CONN="postgres://postgres@127.0.0.1/test?sslmode=disable"
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- psql -c 'create database test;' -U postgres
|
||||||
|
|
||||||
|
addons:
|
||||||
|
postgresql: "9.3"
|
||||||
|
|
||||||
|
sudo: false
|
4
Makefile
4
Makefile
@@ -6,8 +6,8 @@ build:
|
|||||||
get-deps:
|
get-deps:
|
||||||
@go get -d -v ./...
|
@go get -d -v ./...
|
||||||
|
|
||||||
test:
|
test: get-deps
|
||||||
@go test ./...
|
@go test -v ./...
|
||||||
|
|
||||||
format:
|
format:
|
||||||
@go fmt ./...
|
@go fmt ./...
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
|||||||
func TestCleanup(t *testing.T) {
|
func TestCleanup(t *testing.T) {
|
||||||
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
||||||
if ss == nil {
|
if ss == nil {
|
||||||
t.Fatal("This test requires a real database")
|
t.Skip("This test requires a real database")
|
||||||
}
|
}
|
||||||
|
|
||||||
defer ss.Close()
|
defer ss.Close()
|
||||||
|
@@ -30,7 +30,7 @@ func TestPGStore(t *testing.T) {
|
|||||||
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
||||||
|
|
||||||
if ss == nil {
|
if ss == nil {
|
||||||
t.Fatal("This test requires a real database")
|
t.Skip("This test requires a real database")
|
||||||
}
|
}
|
||||||
|
|
||||||
defer ss.Close()
|
defer ss.Close()
|
||||||
@@ -124,7 +124,7 @@ func TestSessionOptionsAreUniquePerSession(t *testing.T) {
|
|||||||
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
ss := NewPGStore(os.Getenv("PGSTORE_TEST_CONN"), []byte(secret))
|
||||||
|
|
||||||
if ss == nil {
|
if ss == nil {
|
||||||
t.Fatal("This test requires a real database")
|
t.Skip("This test requires a real database")
|
||||||
}
|
}
|
||||||
|
|
||||||
defer ss.Close()
|
defer ss.Close()
|
||||||
|
Reference in New Issue
Block a user