diff --git a/hw12_13_14_15_calendar/Makefile b/hw12_13_14_15_calendar/Makefile index 95971ff..68278dd 100644 --- a/hw12_13_14_15_calendar/Makefile +++ b/hw12_13_14_15_calendar/Makefile @@ -1,11 +1,25 @@ cdir = $(shell pwd) -integration-test: +inplace-integration-test: go test -count 10 -race ./cmd/calendar/... --config ./../../configs/calendar.conf bdd: docker build -t bdd --network host -f test/Dockerfile . +integration-test: + set -e ;\ + docker-compose -f ./cicd/dc_sup.yml up -d --build ;\ + docker-compose -f ./cicd/dc_calendar.yml up -d --build ;\ + docker-compose -f ./cicd/dc_sender.yml up -d --build ;\ + docker-compose -f ./cicd/dc_sheduler.yml up -d --build ;\ + test_status_code=0 ;\ + docker build -t bdd --network host -f test/Dockerfile . || test_status_code=$$? ;\ + docker-compose -f ./cicd/dc_sup.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\ + docker-compose -f ./cicd/dc_calendar.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\ + docker-compose -f ./cicd/dc_sender.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\ + docker-compose -f ./cicd/dc_sheduler.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\ + exit $$test_status_code + test: go test -race ./internal/... ./pkg/... @@ -43,7 +57,4 @@ sup-up: sup-down: docker-compose -f ./cicd/dc_sup.yml down -clean: - docker rmi $(sudo docker images | grep '' | awk '{print $3}') - .PHONY: build run test lint \ No newline at end of file