Merge branch 'master' of https://github.com/VinGarcia/ksql into change-test-lib-reference

pull/24/head
Jadson Medeiros 2022-07-06 20:25:46 -03:00
commit 2c8cde5a6a
4 changed files with 11 additions and 14 deletions

View File

@ -9,8 +9,8 @@ jobs:
- uses: actions/checkout@v2
- name: Pull Postgres
run: docker pull postgres:14.0
- name: Pull MySQL
run: docker pull mysql:8.0.27
- name: Pull MariaDB
run: docker pull mariadb:10.8
- name: Pull SQLServer
run: docker pull mcr.microsoft.com/mssql/server:2017-latest
- name: Check go version

View File

@ -27,7 +27,7 @@ lint: setup go-mod-tidy
# Run go mod tidy for all submodules:
go-mod-tidy:
@find -name go.mod -execdir go mod tidy \;
find . -name go.mod -execdir go mod tidy \;
gen: mock
mock: setup
@ -36,15 +36,14 @@ mock: setup
setup: $(GOBIN)/richgo $(GOBIN)/staticcheck $(GOBIN)/mockgen
$(GOBIN)/richgo:
go get github.com/kyoh86/richgo
go install github.com/kyoh86/richgo@latest
$(GOBIN)/staticcheck:
go install honnef.co/go/tools/cmd/staticcheck@latest
$(GOBIN)/mockgen:
@# (Gomock is used on examples/example_service)
go get github.com/golang/mock/gomock
go get github.com/golang/mock/mockgen
go install github.com/golang/mock/mockgen@latest
# Running examples:
exampleservice: mock

View File

@ -36,11 +36,11 @@ func startMySQLDB(dbName string) (databaseURL string, closer func()) {
// pulls an image, creates a container based on it and runs it
resource, err := pool.RunWithOptions(
&dockertest.RunOptions{
Repository: "mysql",
Tag: "8.0.27",
Repository: "mariadb",
Tag: "10.8",
Env: []string{
"MYSQL_ROOT_PASSWORD=mysql",
"MYSQL_DATABASE=" + dbName,
"MARIADB_ROOT_PASSWORD=mysql",
"MARIADB_DATABASE=" + dbName,
},
},
func(config *docker.HostConfig) {
@ -56,7 +56,7 @@ func startMySQLDB(dbName string) (databaseURL string, closer func()) {
hostAndPort := resource.GetHostPort("3306/tcp")
databaseUrl := fmt.Sprintf("root:mysql@(%s)/%s?timeout=30s", hostAndPort, dbName)
fmt.Println("Connecting to mysql on url: ", databaseUrl)
fmt.Println("Connecting to mariadb on url: ", databaseUrl)
resource.Expire(40) // Tell docker to hard kill the container in 40 seconds

View File

@ -21,8 +21,6 @@ export PATH=$PATH:$(pwd)/scripts
( cd adapters/kpgx ; run-with-replace.sh go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/vingarcia/ksql ./... )
( cd adapters/ksqlite3 ; run-with-replace.sh go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/vingarcia/ksql ./... )
( cd adapters/ksqlserver ; run-with-replace.sh go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/vingarcia/ksql ./... )
# Disabled this one because the mysql container fails to start too often on the CI:
#( cd adapters/kmysql ; run-with-replace.sh go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/vingarcia/ksql ./... )
( cd adapters/kmysql ; run-with-replace.sh go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/vingarcia/ksql ./... )
# codecov will find all `coverate.txt` files, so it will work fine.