Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
fix(#654) run integration tests without docker (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek authored Nov 27, 2018
1 parent 9a1fbb4 commit 9b2288f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .make/docker-compose.integration-test.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: '2.1'
services:
postgres_integration_test:
image: centos/postgresql-95-centos7
image: registry.centos.org/postgresql/postgresql:9.6
network_mode: "bridge"
ports:
- "5432"
- "5432:5432"
environment:
POSTGRESQL_ADMIN_PASSWORD: mysecretpassword
healthcheck:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ app/controllers.go: $(DESIGNS) $(GOAGEN_BIN) $(VENDOR_DIR)
.PHONY: migrate-database
## Compiles the server and runs the database migration with it
migrate-database: $(BINARY_SERVER_BIN)
$(BINARY_SERVER_BIN) -migrateDatabase
F8_POSTGRES_DATABASE=postgres $(BINARY_SERVER_BIN) -migrateDatabase

.PHONY: generate
## Generate GOA sources. Only necessary after clean of if changed `design` folder.
Expand Down
18 changes: 6 additions & 12 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,32 +91,26 @@ You can do the same clean, generate and fetch the dependencies as it is suggeste
$ make clean && make generate && make deps
```

Integration tests need to have a DB running. To use that we need to use a docker image for the build. For now just start it and install all necessary binaries in it:
```
$ make docker-start && make docker-prebuild-check
```

And start the DB:
Start the DB:
```
$ make integration-test-env-prepare
```

Run all integration tests inside of the docker container (without code coverage):
Run all integration tests (without code coverage):
```
$ make docker-test-migration && make docker-test-integration-no-coverage && make docker-test-remote-no-coverage
$ make test-migration && make test-integration-no-coverage && make test-remote-no-coverage
```

To stop containers:
To stop DB:
```
$ make integration-test-env-tear-down
$ make docker-rm
```

==== Run all tests

Expecting that the docker container is running as well as the DB (see <<Run integration tests>>) you can trigger all tests by a command:
Expecting that the DB is running (see <<Run integration tests>>) you can trigger all tests by a command:
```
make docker-test-all
make test-all
```

==== Code formatting
Expand Down
12 changes: 0 additions & 12 deletions docker-compose.yml

This file was deleted.

0 comments on commit 9b2288f

Please sign in to comment.