Retry create issue to cope with duplicate keys (#7898)
	
		
	
				
					
				
			* Retry create issue to cope with duplicate keys * Use .SetExpr().Where().Insert()tokarchuk/v1.17
							parent
							
								
									541fab196f
								
							
						
					
					
						commit
						5fe2ec264f
					
				@ -1,125 +1,431 @@ | 
				
			|||||||
 | 
					--- | 
				
			||||||
 | 
					kind: pipeline | 
				
			||||||
 | 
					name: matrix-1 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					platform: | 
				
			||||||
 | 
					  os: linux | 
				
			||||||
 | 
					  arch: amd64 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clone: | 
				
			||||||
 | 
					  disable: true | 
				
			||||||
 | 
					
 | 
				
			||||||
workspace: | 
					workspace: | 
				
			||||||
  base: /go | 
					  base: /go | 
				
			||||||
  path: src/github.com/go-xorm/xorm | 
					  path: src/github.com/go-xorm/xorm | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps: | 
				
			||||||
 | 
					- name: git | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: plugins/git:next | 
				
			||||||
 | 
					  settings: | 
				
			||||||
 | 
					    depth: 50 | 
				
			||||||
 | 
					    tags: true | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: init_postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "until psql -U postgres -d xorm_test -h pgsql \\\n -c \"SELECT 1;\" >/dev/null 2>&1; do sleep 1; done\n" | 
				
			||||||
 | 
					  - "psql -U postgres -d xorm_test -h pgsql \\\n  -c \"create schema xorm;\"\n" | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: build | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - go get -t -d -v ./... | 
				
			||||||
 | 
					  - go get -u xorm.io/core | 
				
			||||||
 | 
					  - go get -u xorm.io/builder | 
				
			||||||
 | 
					  - go build -v | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-sqlite | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - go get -u github.com/wadey/gocovmerge | 
				
			||||||
 | 
					  - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-utf8mb4 | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mymysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-postgres-schema | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.10 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  - 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 > coverage.txt | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services: | 
				
			||||||
 | 
					- name: mysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: mysql:5.7 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    MYSQL_ALLOW_EMPTY_PASSWORD: yes | 
				
			||||||
 | 
					    MYSQL_DATABASE: xorm_test | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - tag | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: pgsql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    POSTGRES_DB: xorm_test | 
				
			||||||
 | 
					    POSTGRES_USER: postgres | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - tag | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- | 
				
			||||||
 | 
					kind: pipeline | 
				
			||||||
 | 
					name: matrix-2 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					platform: | 
				
			||||||
 | 
					  os: linux | 
				
			||||||
 | 
					  arch: amd64 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clone: | 
				
			||||||
 | 
					  disable: true | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					workspace: | 
				
			||||||
 | 
					  base: /go | 
				
			||||||
 | 
					  path: src/github.com/go-xorm/xorm | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps: | 
				
			||||||
 | 
					- name: git | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: plugins/git:next | 
				
			||||||
 | 
					  settings: | 
				
			||||||
 | 
					    depth: 50 | 
				
			||||||
 | 
					    tags: true | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: init_postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "until psql -U postgres -d xorm_test -h pgsql \\\n -c \"SELECT 1;\" >/dev/null 2>&1; do sleep 1; done\n" | 
				
			||||||
 | 
					  - "psql -U postgres -d xorm_test -h pgsql \\\n  -c \"create schema xorm;\"\n" | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: build | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					    - go get -t -d -v ./...	 | 
				
			||||||
 | 
					    - go get -u xorm.io/core	 | 
				
			||||||
 | 
					    - go get -u xorm.io/builder | 
				
			||||||
 | 
					    - GO111MODULE=off go build -v | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: build-gomod | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    GOPROXY: "https://goproxy.cn" | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					    - GO111MODULE=on go build -v | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-sqlite | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - go get -u github.com/wadey/gocovmerge | 
				
			||||||
 | 
					  - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-utf8mb4 | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mymysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-postgres-schema | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.11 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  - 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 > coverage.txt | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services: | 
				
			||||||
 | 
					- name: mysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: mysql:5.7 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    MYSQL_ALLOW_EMPTY_PASSWORD: yes | 
				
			||||||
 | 
					    MYSQL_DATABASE: xorm_test | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - tag | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: pgsql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    POSTGRES_DB: xorm_test | 
				
			||||||
 | 
					    POSTGRES_USER: postgres | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - tag | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- | 
				
			||||||
 | 
					kind: pipeline | 
				
			||||||
 | 
					name: matrix-3 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					platform: | 
				
			||||||
 | 
					  os: linux | 
				
			||||||
 | 
					  arch: amd64 | 
				
			||||||
 | 
					
 | 
				
			||||||
clone: | 
					clone: | 
				
			||||||
  git: | 
					  disable: true | 
				
			||||||
    image: plugins/git:next | 
					
 | 
				
			||||||
 | 
					workspace: | 
				
			||||||
 | 
					  base: /go | 
				
			||||||
 | 
					  path: src/github.com/go-xorm/xorm | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps: | 
				
			||||||
 | 
					- name: git | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: plugins/git:next | 
				
			||||||
 | 
					  settings: | 
				
			||||||
    depth: 50 | 
					    depth: 50 | 
				
			||||||
    tags: true | 
					    tags: true | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: init_postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "until psql -U postgres -d xorm_test -h pgsql \\\n -c \"SELECT 1;\" >/dev/null 2>&1; do sleep 1; done\n" | 
				
			||||||
 | 
					  - "psql -U postgres -d xorm_test -h pgsql \\\n  -c \"create schema xorm;\"\n" | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: build | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					    - go get -t -d -v ./...	 | 
				
			||||||
 | 
					    - go get -u xorm.io/core	 | 
				
			||||||
 | 
					    - go get -u xorm.io/builder | 
				
			||||||
 | 
					    - GO111MODULE=off go build -v | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: build-gomod | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
 | 
					    GOPROXY: "https://goproxy.cn"  | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					    - GO111MODULE=on go build -v | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-sqlite | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - go get -u github.com/wadey/gocovmerge | 
				
			||||||
 | 
					  - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-utf8mb4 | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-mymysql | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "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-postgres | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test-postgres-schema | 
				
			||||||
 | 
					  pull: default | 
				
			||||||
 | 
					  image: golang:1.12 | 
				
			||||||
 | 
					  commands: | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic" | 
				
			||||||
 | 
					  - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic" | 
				
			||||||
 | 
					  - 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 > coverage.txt | 
				
			||||||
 | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
 | 
					    - push | 
				
			||||||
 | 
					    - pull_request | 
				
			||||||
 | 
					
 | 
				
			||||||
services: | 
					services: | 
				
			||||||
  mysql: | 
					- name: mysql | 
				
			||||||
    image: mysql:5.7 | 
					  pull: default | 
				
			||||||
    environment: | 
					  image: mysql:5.7 | 
				
			||||||
      - MYSQL_DATABASE=xorm_test | 
					  environment: | 
				
			||||||
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes | 
					    MYSQL_ALLOW_EMPTY_PASSWORD: yes | 
				
			||||||
    when: | 
					    MYSQL_DATABASE: xorm_test | 
				
			||||||
      event: [ push, tag, pull_request ] | 
					  when: | 
				
			||||||
 | 
					    event: | 
				
			||||||
  pgsql: | 
					    - push | 
				
			||||||
    image: postgres:9.5 | 
					    - tag | 
				
			||||||
    environment: | 
					    - pull_request | 
				
			||||||
      - POSTGRES_USER=postgres | 
					
 | 
				
			||||||
      - POSTGRES_DB=xorm_test | 
					- name: pgsql | 
				
			||||||
    when: | 
					  pull: default | 
				
			||||||
      event: [ push, tag, pull_request ] | 
					  image: postgres:9.5 | 
				
			||||||
 | 
					  environment: | 
				
			||||||
  #mssql: | 
					    POSTGRES_DB: xorm_test | 
				
			||||||
  #  image: microsoft/mssql-server-linux:2017-CU11 | 
					    POSTGRES_USER: postgres | 
				
			||||||
  #  environment: | 
					  when: | 
				
			||||||
  #    - ACCEPT_EULA=Y | 
					    event: | 
				
			||||||
  #    - SA_PASSWORD=yourStrong(!)Password | 
					    - push | 
				
			||||||
  #    - MSSQL_PID=Developer | 
					    - tag | 
				
			||||||
  #  commands: | 
					    - pull_request | 
				
			||||||
  #    - echo 'CREATE DATABASE xorm_test' > create.sql | 
					 | 
				
			||||||
  #    - /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yourStrong(!)Password -i "create.sql" | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
matrix: | 
					 | 
				
			||||||
  GO_VERSION: | 
					 | 
				
			||||||
    - 1.8 | 
					 | 
				
			||||||
    - 1.9 | 
					 | 
				
			||||||
    - 1.10 | 
					 | 
				
			||||||
    - 1.11 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pipeline: | 
					 | 
				
			||||||
  init_postgres: | 
					 | 
				
			||||||
    image: postgres:9.5 | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      # wait for postgres service to become available | 
					 | 
				
			||||||
      - | | 
					 | 
				
			||||||
        until psql -U postgres -d xorm_test -h pgsql \ | 
					 | 
				
			||||||
         -c "SELECT 1;" >/dev/null 2>&1; do sleep 1; done | 
					 | 
				
			||||||
      # query the database | 
					 | 
				
			||||||
      - | | 
					 | 
				
			||||||
        psql -U postgres -d xorm_test -h pgsql \ | 
					 | 
				
			||||||
          -c "create schema xorm;" | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  build: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go get -t -d -v ./... | 
					 | 
				
			||||||
      - go get -u xorm.io/core | 
					 | 
				
			||||||
      - go get -u xorm.io/builder | 
					 | 
				
			||||||
      - go build -v | 
					 | 
				
			||||||
    when: | 
					 | 
				
			||||||
      event: [ push, pull_request ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  test-sqlite: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go get -u github.com/wadey/gocovmerge | 
					 | 
				
			||||||
      - go test -v -race -db="sqlite3" -conn_str="./test.db" -coverprofile=coverage1-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - go test -v -race -db="sqlite3" -conn_str="./test.db" -cache=true -coverprofile=coverage1-2.txt -covermode=atomic | 
					 | 
				
			||||||
    when: | 
					 | 
				
			||||||
      event: [ push, pull_request ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  test-mysql: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go test -v -race -db="mysql" -conn_str="root:@tcp(mysql)/xorm_test" -coverprofile=coverage2-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - 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 ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  test-mysql-utf8mb4: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go test -v -race -db="mysql" -conn_str="root:@tcp(mysql)/xorm_test?charset=utf8mb4" -coverprofile=coverage2.1-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - 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 ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  test-mymysql: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go test -v -race -db="mymysql" -conn_str="tcp:mysql:3306*xorm_test/root/" -coverprofile=coverage3-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - 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 ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  test-postgres: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go test -v -race -db="postgres" -conn_str="postgres://postgres:@pgsql/xorm_test?sslmode=disable" -coverprofile=coverage4-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - go test -v -race -db="postgres" -conn_str="postgres://postgres:@pgsql/xorm_test?sslmode=disable" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic | 
					 | 
				
			||||||
    when: | 
					 | 
				
			||||||
      event: [ push, pull_request ] | 
					 | 
				
			||||||
   | 
					 | 
				
			||||||
  test-postgres-schema: | 
					 | 
				
			||||||
    image: golang:${GO_VERSION} | 
					 | 
				
			||||||
    commands: | 
					 | 
				
			||||||
      - go test -v -race -db="postgres" -conn_str="postgres://postgres:@pgsql/xorm_test?sslmode=disable" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic | 
					 | 
				
			||||||
      - go test -v -race -db="postgres" -conn_str="postgres://postgres:@pgsql/xorm_test?sslmode=disable" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic | 
					 | 
				
			||||||
      - 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 > coverage.txt | 
					 | 
				
			||||||
    when: | 
					 | 
				
			||||||
      event: [ push, pull_request ] | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  #coverage: | 
					 | 
				
			||||||
  #  image: robertstettner/drone-codecov | 
					 | 
				
			||||||
  #  secrets: [ codecov_token ] | 
					 | 
				
			||||||
  #  files: | 
					 | 
				
			||||||
  #    - coverage.txt | 
					 | 
				
			||||||
  #  when: | 
					 | 
				
			||||||
  #    event: [ push, pull_request ] | 
					 | 
				
			||||||
  #    branch: [ master ] | 
					 | 
				
			||||||
									
										
											File diff suppressed because it is too large
											Load Diff
										
									
								
							
						@ -0,0 +1,42 @@ | 
				
			|||||||
 | 
					workspace: | 
				
			||||||
 | 
					  base: /go | 
				
			||||||
 | 
					  path: src/xorm.io/core | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clone: | 
				
			||||||
 | 
					  git: | 
				
			||||||
 | 
					    image: plugins/git:next | 
				
			||||||
 | 
					    depth: 50 | 
				
			||||||
 | 
					    tags: true | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					matrix: | 
				
			||||||
 | 
					  GO_VERSION: | 
				
			||||||
 | 
					    - 1.9 | 
				
			||||||
 | 
					    - 1.10 | 
				
			||||||
 | 
					    - 1.11 | 
				
			||||||
 | 
					    - 1.12 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pipeline: | 
				
			||||||
 | 
					  test: | 
				
			||||||
 | 
					    image: golang:${GO_VERSION} | 
				
			||||||
 | 
					    environment: | 
				
			||||||
 | 
					      GOPROXY: https://goproxy.cn | 
				
			||||||
 | 
					    commands: | 
				
			||||||
 | 
					      - go get -u golang.org/x/lint/golint | 
				
			||||||
 | 
					      - go get -u github.com/stretchr/testify/assert | 
				
			||||||
 | 
					      - go get -u github.com/go-xorm/sqlfiddle | 
				
			||||||
 | 
					      - go get -u github.com/go-sql-driver/mysql | 
				
			||||||
 | 
					      - go get -u github.com/mattn/go-sqlite3 | 
				
			||||||
 | 
					      - go vet | 
				
			||||||
 | 
					      - go test -v -race -coverprofile=coverage.txt -covermode=atomic -dbConn="root:@tcp(mysql:3306)/core_test?charset=utf8mb4" | 
				
			||||||
 | 
					    when: | 
				
			||||||
 | 
					      event: [ push, tag, pull_request ] | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services: | 
				
			||||||
 | 
					  mysql: | 
				
			||||||
 | 
					    image: mysql:5.7 | 
				
			||||||
 | 
					    environment: | 
				
			||||||
 | 
					      - MYSQL_DATABASE=core_test | 
				
			||||||
 | 
					      - MYSQL_ALLOW_EMPTY_PASSWORD=yes | 
				
			||||||
 | 
					    when: | 
				
			||||||
 | 
					      event: [ push, tag, pull_request ] | 
				
			||||||
@ -1,9 +1,23 @@ | 
				
			|||||||
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= | 
					github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= | 
				
			||||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= | 
					github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= | 
				
			||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | 
					github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | 
				
			||||||
 | 
					github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | 
				
			||||||
github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= | 
					github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= | 
				
			||||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= | 
					github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | 
				
			||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | 
					golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= | 
				
			||||||
 | 
					golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 
				
			||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 
					golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 
				
			||||||
 | 
					golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | 
				
			||||||
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= | 
					google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= | 
				
			||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | 
					google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | 
				
			||||||
 | 
					google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | 
				
			||||||
 | 
				
			|||||||
					Loading…
					
					
				
		Reference in new issue