-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (40 loc) · 1.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
###
test:
go test ./...
app-generate:
cd ./cmd/aznum2words-webapp/api \
&& oapi-codegen -config models.cfg.yaml ./open-api-spec.yaml \
&& oapi-codegen -config converter-server.cfg.yaml ./open-api-spec.yaml \
&& oapi-codegen -config health-server.cfg.yaml ./open-api-spec.yaml
### WEBAPP
# we will put our integration testing in this path
WEBAPP_INTEGRATION_TEST_PATH?=./cmd/aznum2words-webapp/it
# set of env variables that you need for testing
WEBAPP_ENV_LOCAL_TEST=\
APP_HOST=0.0.0.0 \
APP_PORT=8080 \
METRIC_PORT=9090 \
DEPLOY_ENV=LOCAL
# this command will start a docker components that we set in docker-compose.webapp.integration.yml
webapp-docker-start-components:
docker-compose -f ./docker-compose.webapp.integration.yml up -d
# shutting down docker components
webapp-docker-stop:
docker-compose -f docker-compose.webapp.integration.yml down
# this command will trigger integration test
# WEBAPP_INTEGRATION_TEST_PATH is used for run specific test in Golang, if it's not specified
# it will run all tests under ./cmd/aznum2words-webapp/it directory
webapp-test-integration:
#go test -tags=integration $(WEBAPP_INTEGRATION_TEST_PATH) -count=1 -run=$(WEBAPP_INTEGRATION_TEST_PATH)
go test -tags=integration $(WEBAPP_INTEGRATION_TEST_PATH) -count=1 -v
#### CLI APP
# we will put our cli-app related integration testing in this path
CLIAPP_INTEGRATION_TEST_PATH?=./cmd/aznum2words-cli
cliapp-build:
go build cmd/aznum2words-cli/aznum2words-cli.go
cliapp-build-integration:
go build -tags integration cmd/aznum2words-cli/aznum2words-cli.go
cliapp-test-integration: cliapp-build-integration
go test -tags=integration $(CLIAPP_INTEGRATION_TEST_PATH) -count=1 -run=$(CLIAPP_INTEGRATION_TEST_PATH)
cliapp-test-integration-debug: cliapp-build-integration
go test -tags=integration $(CLIAPP_INTEGRATION_TEST_PATH) -count=1 -v -run=$(CLIAPP_INTEGRATION_TEST_PATH)