Improve drone
This commit is contained in:
parent
021b68ea25
commit
2eb01148e1
224
.drone.yml
224
.drone.yml
|
@ -3,7 +3,6 @@ kind: pipeline
|
||||||
name: testing
|
name: testing
|
||||||
steps:
|
steps:
|
||||||
- name: test-vet
|
- name: test-vet
|
||||||
pull: default
|
|
||||||
image: golang:1.12
|
image: golang:1.12
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
|
@ -16,44 +15,102 @@ steps:
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
- name: test-sqlite
|
- name: test-sqlite
|
||||||
pull: default
|
|
||||||
image: golang:1.12
|
image: golang:1.12
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic"
|
- make test-sqlite
|
||||||
- "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -cache=true -coverprofile=coverage1-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-sqlite-cache
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-sqlite
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
- name: test-mysql
|
- name: test-mysql
|
||||||
pull: default
|
|
||||||
image: golang:1.12
|
image: golang:1.12
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_CHARSET: utf8
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic"
|
- make test-mysql
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -cache=true -coverprofile=coverage2-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-mysql-cache
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_CHARSET: utf8
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-mysql
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
- name: test-mysql-utf8mb4
|
- name: test-mysql-utf8mb4
|
||||||
pull: default
|
|
||||||
image: golang:1.12
|
image: golang:1.12
|
||||||
depends_on:
|
depends_on:
|
||||||
- test-mysql
|
- test-mysql
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_CHARSET: utf8mb4
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic"
|
- make test-mysql
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -cache=true -coverprofile=coverage2.1-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-mysql-utf8mb4-cache
|
||||||
|
image: golang:1.12
|
||||||
|
depends_on:
|
||||||
|
- test-mysql
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_CHARSET: utf8mb4
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-mysql
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -67,9 +124,33 @@ steps:
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic"
|
- make test-mymysql
|
||||||
- "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -cache=true -coverprofile=coverage3-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-mymysql-cache
|
||||||
|
pull: default
|
||||||
|
image: golang:1.12
|
||||||
|
depends_on:
|
||||||
|
- test-mysql-utf8mb4
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-mymysql
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -81,9 +162,31 @@ steps:
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_PGSQL_HOST: pgsql
|
||||||
|
TEST_PGSQL_DBNAME: xorm_test
|
||||||
|
TEST_PGSQL_USERNAME: postgres
|
||||||
|
TEST_PGSQL_PASSWORD: postgres
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:postgres@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic"
|
- make test-postgres
|
||||||
- "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:postgres@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-postgres-cache
|
||||||
|
pull: default
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_PGSQL_HOST: pgsql
|
||||||
|
TEST_PGSQL_DBNAME: xorm_test
|
||||||
|
TEST_PGSQL_USERNAME: postgres
|
||||||
|
TEST_PGSQL_PASSWORD: postgres
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-postgres
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -95,9 +198,35 @@ steps:
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_PGSQL_HOST: pgsql
|
||||||
|
TEST_PGSQL_SCHEMA: xorm
|
||||||
|
TEST_PGSQL_DBNAME: xorm_test
|
||||||
|
TEST_PGSQL_USERNAME: postgres
|
||||||
|
TEST_PGSQL_PASSWORD: postgres
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
|
SCHEMA: xorm
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:postgres@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic"
|
- make test-postgres
|
||||||
- "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:postgres@pgsql/xorm_test?sslmode=disable\" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-postgres-schema-cache
|
||||||
|
pull: default
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_PGSQL_HOST: pgsql
|
||||||
|
TEST_PGSQL_SCHEMA: xorm
|
||||||
|
TEST_PGSQL_DBNAME: xorm_test
|
||||||
|
TEST_PGSQL_USERNAME: postgres
|
||||||
|
TEST_PGSQL_PASSWORD: postgres
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
SCHEMA: xorm
|
||||||
|
commands:
|
||||||
|
- make test-postgres
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -109,9 +238,31 @@ steps:
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MSSQL_HOST: mssql
|
||||||
|
TEST_MSSQL_DBNAME: xorm_test
|
||||||
|
TEST_MSSQL_USERNAME: sa
|
||||||
|
TEST_MSSQL_PASSWORD: "yourStrong(!)Password"
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"mssql\" -conn_str=\"server=mssql;user id=sa;password=yourStrong(!)Password;database=xorm_test\" -coverprofile=coverage6-1.txt -covermode=atomic"
|
- make test-mssql
|
||||||
- "go test -v -race -db=\"mssql\" -conn_str=\"server=mssql;user id=sa;password=yourStrong(!)Password;database=xorm_test\" -cache=true -coverprofile=coverage6-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-mssql-cache
|
||||||
|
pull: default
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_MSSQL_HOST: mssql
|
||||||
|
TEST_MSSQL_DBNAME: xorm_test
|
||||||
|
TEST_MSSQL_USERNAME: sa
|
||||||
|
TEST_MSSQL_PASSWORD: "yourStrong(!)Password"
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-mssql
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -123,9 +274,31 @@ steps:
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "https://goproxy.cn"
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_TIDB_HOST: "tidb:4000"
|
||||||
|
TEST_TIDB_DBNAME: xorm_test
|
||||||
|
TEST_TIDB_USERNAME: root
|
||||||
|
TEST_TIDB_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: false
|
||||||
commands:
|
commands:
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -coverprofile=coverage7-1.txt -covermode=atomic"
|
- make test-tidb
|
||||||
- "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -cache=true -coverprofile=coverage7-2.txt -covermode=atomic"
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: test-tidb-cache
|
||||||
|
pull: default
|
||||||
|
image: golang:1.12
|
||||||
|
environment:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
GOPROXY: "https://goproxy.cn"
|
||||||
|
TEST_TIDB_HOST: "tidb:4000"
|
||||||
|
TEST_TIDB_DBNAME: xorm_test
|
||||||
|
TEST_TIDB_USERNAME: root
|
||||||
|
TEST_TIDB_PASSWORD:
|
||||||
|
TEST_CACHE_ENABLE: true
|
||||||
|
commands:
|
||||||
|
- make test-tidb
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -140,16 +313,23 @@ steps:
|
||||||
depends_on:
|
depends_on:
|
||||||
- test-vet
|
- test-vet
|
||||||
- test-sqlite
|
- test-sqlite
|
||||||
|
- test-sqlite-cache
|
||||||
- test-mysql
|
- test-mysql
|
||||||
|
- test-mysql-cache
|
||||||
- test-mysql-utf8mb4
|
- test-mysql-utf8mb4
|
||||||
|
- test-mysql-utf8mb4-cache
|
||||||
- test-mymysql
|
- test-mymysql
|
||||||
|
- test-mymysql-cache
|
||||||
- test-postgres
|
- test-postgres
|
||||||
|
- test-postgres-cache
|
||||||
- test-postgres-schema
|
- test-postgres-schema
|
||||||
|
- test-postgres-schema-cache
|
||||||
- test-mssql
|
- test-mssql
|
||||||
|
- test-mssql-cache
|
||||||
- test-tidb
|
- test-tidb
|
||||||
|
- test-tidb-cache
|
||||||
commands:
|
commands:
|
||||||
- go get github.com/wadey/gocovmerge
|
- make coverage
|
||||||
- gocovmerge coverage1-1.txt coverage1-2.txt coverage2-1.txt coverage2-2.txt coverage2.1-1.txt coverage2.1-2.txt coverage3-1.txt coverage3-2.txt coverage4-1.txt coverage4-2.txt coverage5-1.txt coverage5-2.txt coverage6-1.txt coverage6-2.txt coverage7-1.txt coverage7-2.txt > coverage.txt
|
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|
89
Makefile
89
Makefile
|
@ -16,20 +16,24 @@ TEST_MSSQL_USERNAME ?= sa
|
||||||
TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
|
TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
|
||||||
|
|
||||||
TEST_MYSQL_HOST ?= mysql:3306
|
TEST_MYSQL_HOST ?= mysql:3306
|
||||||
|
TEST_MYSQL_CHARSET ?= utf8
|
||||||
TEST_MYSQL_DBNAME ?= xorm_test
|
TEST_MYSQL_DBNAME ?= xorm_test
|
||||||
TEST_MYSQL_USERNAME ?= root
|
TEST_MYSQL_USERNAME ?= root
|
||||||
TEST_MYSQL_PASSWORD ?=
|
TEST_MYSQL_PASSWORD ?=
|
||||||
|
|
||||||
TEST_PGSQL_HOST ?= pgsql:5432
|
TEST_PGSQL_HOST ?= pgsql:5432
|
||||||
TEST_PGSQL_DBNAME ?= testgitea
|
TEST_PGSQL_SCHEMA ?=
|
||||||
|
TEST_PGSQL_DBNAME ?= xorm_test
|
||||||
TEST_PGSQL_USERNAME ?= postgres
|
TEST_PGSQL_USERNAME ?= postgres
|
||||||
TEST_PGSQL_PASSWORD ?= postgres
|
TEST_PGSQL_PASSWORD ?= mysecretpassword
|
||||||
|
|
||||||
TEST_TIDB_HOST ?= tidb:4000
|
TEST_TIDB_HOST ?= tidb:4000
|
||||||
TEST_TIDB_DBNAME ?= xorm_test
|
TEST_TIDB_DBNAME ?= xorm_test
|
||||||
TEST_TIDB_USERNAME ?= root
|
TEST_TIDB_USERNAME ?= root
|
||||||
TEST_TIDB_PASSWORD ?=
|
TEST_TIDB_PASSWORD ?=
|
||||||
|
|
||||||
|
TEST_CACHE_ENABLE ?= false
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
@ -40,7 +44,14 @@ build: go-check $(GO_SOURCES)
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
$(GO) clean -i ./...
|
$(GO) clean -i ./...
|
||||||
rm -rf *.sql *.log test.db
|
rm -rf *.sql *.log test.db *coverage.out coverage.all
|
||||||
|
|
||||||
|
.PHONY: coverage
|
||||||
|
coverage:
|
||||||
|
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
|
$(GO) get -u github.com/wadey/gocovmerge; \
|
||||||
|
fi
|
||||||
|
gocovmerge $(shell find . -type f -name "coverage.out") > coverage.all;\
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt:
|
fmt:
|
||||||
|
@ -106,70 +117,74 @@ test: test-sqlite
|
||||||
|
|
||||||
.PNONY: test-mssql
|
.PNONY: test-mssql
|
||||||
test-mssql: go-check
|
test-mssql: go-check
|
||||||
$(GO) test -race -db=mssql -conn_str="server=$(TEST_MSSQL_HOST);user id=$(TEST_MSSQL_USERNAME);password=$(TEST_MSSQL_PASSWORD);database=$(TEST_MSSQL_DBNAME)"
|
$(GO) test -race -db=mssql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="server=$(TEST_MSSQL_HOST);user id=$(TEST_MSSQL_USERNAME);password=$(TEST_MSSQL_PASSWORD);database=$(TEST_MSSQL_DBNAME)" \
|
||||||
.PNONY: test-mssql-cache
|
-coverprofile=mssql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
test-mssql-cache: go-check
|
|
||||||
$(GO) test -race -db=mssql -cache=true -conn_str="server=$(TEST_MSSQL_HOST);user id=$(TEST_MSSQL_USERNAME);password=$(TEST_MSSQL_PASSWORD);database=$(TEST_MSSQL_DBNAME)"
|
|
||||||
|
|
||||||
|
.PNONY: test-mssql\#%
|
||||||
|
test-mssql\#%: go-check
|
||||||
|
$(GO) test -race -run $* -db=mssql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="server=$(TEST_MSSQL_HOST);user id=$(TEST_MSSQL_USERNAME);password=$(TEST_MSSQL_PASSWORD);database=$(TEST_MSSQL_DBNAME)" \
|
||||||
|
-coverprofile=mssql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PNONY: test-mymysql
|
.PNONY: test-mymysql
|
||||||
test-mymysql: go-check
|
test-mymysql: go-check
|
||||||
$(GO) test -race -db=mymysql -conn_str="tcp:$(TEST_MYSQL_HOST)*$(TEST_MYSQL_DBNAME)/$(TEST_MYSQL_USERNAME)/$(TEST_MYSQL_PASSWORD)"
|
$(GO) test -race -db=mymysql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="tcp:$(TEST_MYSQL_HOST)*$(TEST_MYSQL_DBNAME)/$(TEST_MYSQL_USERNAME)/$(TEST_MYSQL_PASSWORD)" \
|
||||||
|
-coverprofile=mymysql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PNONY: test-mymysql-cache
|
.PNONY: test-mymysql\#%
|
||||||
test-mymysql-cache: go-check
|
test-mymysql\#%: go-check
|
||||||
$(GO) test -race -db=mymysql -cache=true -conn_str="tcp:$(TEST_MYSQL_HOST)*$(TEST_MYSQL_DBNAME)/$(TEST_MYSQL_USERNAME)/$(TEST_MYSQL_PASSWORD)"
|
$(GO) test -race -run $* -db=mymysql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="tcp:$(TEST_MYSQL_HOST)*$(TEST_MYSQL_DBNAME)/$(TEST_MYSQL_USERNAME)/$(TEST_MYSQL_PASSWORD)" \
|
||||||
|
-coverprofile=mymysql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PNONY: test-mysql
|
.PNONY: test-mysql
|
||||||
test-mysql: go-check
|
test-mysql: go-check
|
||||||
$(GO) test -race -db=mysql -conn_str="$(TEST_MYSQL_USERNAME):$(TEST_MYSQL_PASSWORD)@tcp($(TEST_MYSQL_HOST))/$(TEST_MYSQL_DBNAME)"
|
$(GO) test -race -db=mysql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="$(TEST_MYSQL_USERNAME):$(TEST_MYSQL_PASSWORD)@tcp($(TEST_MYSQL_HOST))/$(TEST_MYSQL_DBNAME)?charset=$(TEST_MYSQL_CHARSET)" \
|
||||||
.PNONY: test-mysql-cache
|
-coverprofile=mysql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
test-mysql-cache: go-check
|
|
||||||
$(GO) test -race -db=mysql -cache=true -conn_str="$(TEST_MYSQL_USERNAME):$(TEST_MYSQL_PASSWORD)@tcp($(TEST_MYSQL_HOST))/$(TEST_MYSQL_DBNAME)"
|
|
||||||
|
|
||||||
.PHONY: test-mysql\#%
|
.PHONY: test-mysql\#%
|
||||||
test-mysql\#%: go-check
|
test-mysql\#%: go-check
|
||||||
$(GO) test -race -run $* -db=mysql -conn_str="$(TEST_MYSQL_USERNAME):$(TEST_MYSQL_PASSWORD)@tcp($(TEST_MYSQL_HOST))/$(TEST_MYSQL_DBNAME)"
|
$(GO) test -race -run $* -db=mysql -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="$(TEST_MYSQL_USERNAME):$(TEST_MYSQL_PASSWORD)@tcp($(TEST_MYSQL_HOST))/$(TEST_MYSQL_DBNAME)?charset=$(TEST_MYSQL_CHARSET)" \
|
||||||
|
-coverprofile=mysql.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PNONY: test-postgres
|
.PNONY: test-postgres
|
||||||
test-postgres: go-check
|
test-postgres: go-check
|
||||||
$(GO) test -race -db=postgres -conn_str="postgres://$(TEST_PGSQL_USERNAME):$(TEST_PGSQL_PASSWORD)@$(TEST_PGSQL_HOST)/$(TEST_PGSQL_DBNAME)?sslmode=disable"
|
$(GO) test -race -db=postgres -schema='$(TEST_PGSQL_SCHEMA)' -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="postgres://$(TEST_PGSQL_USERNAME):$(TEST_PGSQL_PASSWORD)@$(TEST_PGSQL_HOST)/$(TEST_PGSQL_DBNAME)?sslmode=disable" \
|
||||||
.PNONY: test-postgres-cache
|
-coverprofile=postgres.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
test-postgres-cache: go-check
|
|
||||||
$(GO) test -race -db=postgres -cache=true -conn_str="postgres://$(TEST_PGSQL_USERNAME):$(TEST_PGSQL_PASSWORD)@$(TEST_PGSQL_HOST)/$(TEST_PGSQL_DBNAME)?sslmode=disable"
|
|
||||||
|
|
||||||
.PHONY: test-postgres\#%
|
.PHONY: test-postgres\#%
|
||||||
test-postgres\#%: go-check
|
test-postgres\#%: go-check
|
||||||
$(GO) test -race -run $* -db=postgres -conn_str="postgres://$(TEST_PGSQL_USERNAME):$(TEST_PGSQL_PASSWORD)@$(TEST_PGSQL_HOST)/$(TEST_PGSQL_DBNAME)?sslmode=disable"
|
$(GO) test -race -run $* -db=postgres -schema='$(TEST_PGSQL_SCHEMA)' -cache=$(TEST_CACHE_ENABLE) \
|
||||||
|
-conn_str="postgres://$(TEST_PGSQL_USERNAME):$(TEST_PGSQL_PASSWORD)@$(TEST_PGSQL_HOST)/$(TEST_PGSQL_DBNAME)?sslmode=disable" \
|
||||||
|
-coverprofile=postgres.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PHONY: test-sqlite
|
.PHONY: test-sqlite
|
||||||
test-sqlite: go-check
|
test-sqlite: go-check
|
||||||
$(GO) test -race -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc"
|
$(GO) test -race -cache=$(TEST_CACHE_ENABLE) -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" \
|
||||||
|
-coverprofile=sqlite.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
.PHONY: test-sqlite-cache
|
|
||||||
test-sqlite-cache: go-check
|
|
||||||
$(GO) test -race -cache=true -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc"
|
|
||||||
|
|
||||||
.PHONY: test-sqlite\#%
|
.PHONY: test-sqlite\#%
|
||||||
test-sqlite\#%: go-check
|
test-sqlite\#%: go-check
|
||||||
$(GO) test -race -run $* -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc"
|
$(GO) test -race -run $* -cache=$(TEST_CACHE_ENABLE) -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" \
|
||||||
|
-coverprofile=sqlite.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
.PNONY: test-tidb
|
.PNONY: test-tidb
|
||||||
test-tidb: go-check
|
test-tidb: go-check
|
||||||
$(GO) test -race -db=mysql -ignore_select_update=true -conn_str="$(TEST_TIDB_USERNAME):$(TEST_TIDB_PASSWORD)@tcp($(TEST_TIDB_HOST))/$(TEST_TIDB_DBNAME)"
|
$(GO) test -race -db=mysql -cache=$(TEST_CACHE_ENABLE) -ignore_select_update=true \
|
||||||
|
-conn_str="$(TEST_TIDB_USERNAME):$(TEST_TIDB_PASSWORD)@tcp($(TEST_TIDB_HOST))/$(TEST_TIDB_DBNAME)" \
|
||||||
.PNONY: test-tidb-cache
|
-coverprofile=tidb.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
test-tidb-cache: go-check
|
|
||||||
$(GO) test -race -db=mysql -ignore_select_update=true -cache=true -conn_str="$(TEST_TIDB_USERNAME):$(TEST_TIDB_PASSWORD)@tcp($(TEST_TIDB_HOST))/$(TEST_TIDB_DBNAME)"
|
|
||||||
|
|
||||||
.PHONY: test-tidb\#%
|
.PHONY: test-tidb\#%
|
||||||
test-tidb\#%: go-check
|
test-tidb\#%: go-check
|
||||||
$(GO) test -race -run $* -db=mysql -ignore_select_update=true -conn_str="$(TEST_TIDB_USERNAME):$(TEST_TIDB_PASSWORD)@tcp($(TEST_TIDB_HOST))/$(TEST_TIDB_DBNAME)"
|
$(GO) test -race -run $* -db=mysql -cache=$(TEST_CACHE_ENABLE) -ignore_select_update=true \
|
||||||
|
-conn_str="$(TEST_TIDB_USERNAME):$(TEST_TIDB_PASSWORD)@tcp($(TEST_TIDB_HOST))/$(TEST_TIDB_DBNAME)" \
|
||||||
|
-coverprofile=tidb.$(TEST_CACHE_ENABLE).coverage.out -covermode=atomic
|
||||||
|
|
||||||
go test -db=mysql -conn_str="root:@tcp(localhost:4000)/xorm_test" -ignore_select_update=true
|
|
||||||
.PHONY: vet
|
.PHONY: vet
|
||||||
vet:
|
vet:
|
||||||
$(GO) vet $(PACKAGES)
|
$(GO) vet $(PACKAGES)
|
Loading…
Reference in New Issue