-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 2.39 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
52
53
54
55
56
57
58
59
60
61
.PHONY: all
all: public wu
mocks:
mockgen -source internal/services/works_service.go -destination internal/mocks/works_service.go --package mocks
mockgen -source internal/services/activities_service.go -destination internal/mocks/activities_service.go --package mocks
mockgen -source internal/services/users_service.go -destination internal/mocks/users_service.go --package mocks
mockgen -source internal/repositories/transaction_runner.go -destination internal/mocks/transaction_runner.go --package mocks
mockgen -source internal/repositories/works_repository.go -destination internal/mocks/works_repository.go --package mocks
mockgen -source internal/repositories/activities_repository.go -destination internal/mocks/activities_repository.go --package mocks
mockgen -source internal/repositories/users_repository.go -destination internal/mocks/users_repository.go --package mocks
mockgen -source internal/lib/storage_client.go -destination internal/mocks/storage_client.go --package mocks
mockgen -source internal/lib/uuid_generator.go -destination internal/mocks/uuid_generator.go --package mocks
.PHONY: dev_front
dev_front:
yarn dev
.PHONY: dev_back
dev_back: public
air
.PHONY: test_unit_back
test_unit_back:
go test -coverprofile=cover.out -v ./...
go tool cover -html=cover.out -o cover.html
.PHONY: test_unit_front
test_unit_front:
yarn test
.PHONY: test_unit
test_unit: test_unit_back test_unit_front
test_dir=.test
.PHONY: test_api
test_api:
mkdir -p $(test_dir)
go run cmd/wu/main.go > /dev/null &
@curl -f https://api.getpostman.com/collections/$(POSTMAN_COLLECTION_ID)?apikey=$(POSTMAN_API_KEY) > $(test_dir)/api.json
@curl -f https://api.getpostman.com/environments/$(POSTMAN_ENVIRONMENT_ID)?apikey=$(POSTMAN_API_KEY) > $(test_dir)/env.json
@curl -f -G -d 'key=$(PIXABAY_API_KEY)&id=$(PIXABAY_ID_THUMBNAIL)' https://pixabay.com/api/ | jq -r '.hits[0].largeImageURL' | xargs -I@ curl -o .test/test_thumb.jpg @
@curl -f -G -d 'key=$(PIXABAY_API_KEY)&id=$(PIXABAY_ID_CONTENT)' https://pixabay.com/api/ | jq -r '.hits[0].largeImageURL' | xargs -I@ curl -o .test/test_content.jpg @
newman run $(test_dir)/api.json -e $(test_dir)/env.json --working-dir $(test_dir);\
result=$$?;\
lsof -t -i:8000 | xargs kill -9
rm -rf $(test_dir);\
exit $$result
.PHONY: test
test: test_unit test_api
public: nuxt.config.js web
yarn run generate
wu:
go build cmd/wu/main.go
.PHONY: run
run:
go run cmd/wu/main.go