Skip to content

Commit

Permalink
entgo/circleci: run integration tests from docker executer (ent#28)
Browse files Browse the repository at this point in the history
Summary:
Switching to docker executer gives us:
- Faster execution times.
- Removes docker-compose dependency.
- Provides view into DB containers output.

Pull Request resolved: ent#28

Reviewed By: a8m

Differential Revision: D17210011

fbshipit-source-id: 71225939ef16194cf011ec47a5815b42918cbbbd
  • Loading branch information
alexsn authored and facebook-github-bot committed Sep 8, 2019
1 parent d8eab42 commit 397ff3b
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- image: circleci/golang
working_directory: /go/src/github.com/facebookincubator/ent
steps:
- run:
- run: &goimports_install
name: Install goimports
command: go get -u golang.org/x/tools/cmd/goimports
- checkout
Expand All @@ -26,20 +26,30 @@ jobs:
name: Codegen tests
command: go test -v ./entc/gen/...
integration:
machine:
image: ubuntu-1604:201903-01
docker:
- image: circleci/golang
- image: mysql:5.6.35
environment: &mysql_env
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
- image: mysql:5.7.26
environment:
<<: *mysql_env
MYSQL_TCP_PORT: 3307
- image: mysql:8
environment:
<<: *mysql_env
MYSQL_TCP_PORT: 3308
- image: entgo/gremlin-server
entrypoint: /opt/gremlin-server/bin/gremlin-server.sh
command: conf/gremlin-server.yaml
steps:
- checkout
- run:
name: Spin up databases
command: |
cd entc/integration/compose
docker-compose up -d --scale test=0
- run:
name: Run integration tests
command: |
cd entc/integration/compose
docker-compose run test go test ./entc/integration/...
- checkout
- run: *goimports_install
- run:
name: Run integration tests
working_directory: entc/integration
command: go test -v -race ./...
docs:
docker:
- image: circleci/node
Expand Down

0 comments on commit 397ff3b

Please sign in to comment.