-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from KnightHacks/development
Development
- Loading branch information
Showing
20 changed files
with
2,003 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# we will put our integration testing in this path | ||
INTEGRATION_TEST_PATH?=./integration_tests | ||
|
||
# set of env variables that you need for testing | ||
POSTGRES_URI=postgresql://postgres:test@localhost:5432/postgres | ||
|
||
# this command will start a docker components that we set in docker-compose.yml | ||
docker.start.components: | ||
docker-compose -f docker-compose-test.yaml up -d --remove-orphans postgres; | ||
|
||
# shutting down docker components | ||
docker.stop: | ||
docker-compose -f docker-compose-test.yaml down -v | ||
|
||
# this command will trigger integration test | ||
# INTEGRATION_TEST_SUITE_PATH is used for run specific test in Golang, if it's not specified | ||
# it will run all tests under ./integration_tests directory | ||
test.integration: | ||
$(MAKE) docker.start.components | ||
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI) | ||
$(MAKE) docker.stop | ||
|
||
# this command will trigger integration test with verbose mode | ||
test.integration.debug: | ||
$(MAKE) docker.start.components | ||
- go test -tags=integration $(INTEGRATION_TEST_PATH) -count=1 -v -run=$(INTEGRATION_TEST_SUITE_PATH) --integration --postgres-uri=$(POSTGRES_URI) | ||
$(MAKE) docker.stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
postgres: | ||
image: "postgres:15-alpine" | ||
restart: always | ||
command: [ "postgres", "-c", "log_statement=all" ] | ||
environment: | ||
POSTGRES_PASSWORD: test | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ./integration_tests/init.sql:/docker-entrypoint-initdb.d/db.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.