Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
example: enables the generated model tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scbizu committed Apr 23, 2020
1 parent 6dcff1e commit 027b00c
Show file tree
Hide file tree
Showing 19 changed files with 1,488 additions and 1,250 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,29 @@ jobs:
strategy:
matrix:
go: [1.12,1.13,1.14]

runs-on: ubuntu-latest
container: golang:${{ matrix.go }}-stretch

container:
image: golang:${{ matrix.go }}-stretch

services:
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_USER: ezbuy
MYSQL_PASSWORD: ezbuyisthebest
MYSQL_ROOT_PASSWORD: ezbuyisthebest
MYSQL_DATABASE: testing
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -28,8 +49,17 @@ jobs:
GO111MODULE=off go get -u github.com/jteeuwen/go-bindata/...
make buildTpl
- name: Test
- name: Test Builder
run: |
go install
redis-orm code -i ./example/yaml/ -o ./example/model/
go test -v ./orm/sqlbuilder
- name: Test Model
run: |
go test -v ./example/model/
env:
MYSQL_HOST: mysql
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
REDIS_HOST: redis
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
4 changes: 2 additions & 2 deletions example/model/gen.object.blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -1214,9 +1214,9 @@ func (m *_BlogElasticMgr) IndexService() (*elastic.IndexService, error) {
_, err = m.PutMappingService().BodyJson(m.Mapping()).Do()
})

return ElasticClient().IndexService("ezorm").Type("blogs"), err
return ElasticClient().IndexService("testing").Type("blogs"), err
}

func (m *_BlogElasticMgr) PutMappingService() *elastic.PutMappingService {
return ElasticClient().PutMappingService("ezorm ").Type("blogs")
return ElasticClient().PutMappingService("testing ").Type("blogs")
}
Loading

0 comments on commit 027b00c

Please sign in to comment.