From 9b2288f82052207df439b18ef5d867ebd6759848 Mon Sep 17 00:00:00 2001 From: Matous Jobanek Date: Tue, 27 Nov 2018 05:51:05 +0000 Subject: [PATCH] fix(#654) run integration tests without docker (#683) --- .make/docker-compose.integration-test.yaml | 4 ++-- Makefile | 2 +- README.adoc | 18 ++++++------------ docker-compose.yml | 12 ------------ 4 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 docker-compose.yml diff --git a/.make/docker-compose.integration-test.yaml b/.make/docker-compose.integration-test.yaml index 90e2600..55314d5 100644 --- a/.make/docker-compose.integration-test.yaml +++ b/.make/docker-compose.integration-test.yaml @@ -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: diff --git a/Makefile b/Makefile index dba9dc5..b4015af 100644 --- a/Makefile +++ b/Makefile @@ -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. diff --git a/README.adoc b/README.adoc index 59ee776..9146c96 100644 --- a/README.adoc +++ b/README.adoc @@ -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 <>) you can trigger all tests by a command: +Expecting that the DB is running (see <>) you can trigger all tests by a command: ``` -make docker-test-all +make test-all ``` ==== Code formatting diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8d7f324..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '2' - -services: - db: - image: registry.centos.org/postgresql/postgresql:9.6 - ports: - - "5434:5432" - environment: - # POSTGRESQL_USER: postgres - # POSTGRESQL_PASSWORD: mysecretpassword - # POSTGRESQL_DATABASE: tenant - POSTGRESQL_ADMIN_PASSWORD: mysecretpassword