forked from uber/tchannel-python
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
82 lines (62 loc) · 1.51 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
project := tchannel
flake8 := flake8
pytest := PYTHONDONTWRITEBYTECODE=1 py.test --tb short \
--cov-config .coveragerc --cov $(project) \
--async-test-timeout=1 --timeout=30 tests
html_report := --cov-report html
test_args := --cov-report term-missing
TEST_HOST=127.0.0.1
TEST_PORT=0
TEST_LOG_FILE=test-server.log
.DEFAULT_GOAL := test-lint
env/bin/activate:
virtualenv env
env_install: env/bin/activate
./env/bin/pip install -r requirements-test.txt
./env/bin/python setup.py develop
.PHONY: tox_install
tox_install:
pip install -r requirements-test.txt
python setup.py develop
.PHONY: install
install: clean
ifdef TOX_ENV
make tox_install
else
make env_install
endif
.PHONY: test_server
test_server:
# TODO: use ${TEST_LOG_FILE}
./env/bin/python examples/tchannel_server.py --host ${TEST_HOST} --port ${TEST_PORT}
.PHONY: test
test: clean
$(pytest) $(test_args)
.PHONY: test_ci
test_ci: clean
tox -e $(TOX_ENV) -- tests
.PHONY: testhtml
testhtml: clean
$(pytest) $(html_report) && open htmlcov/index.html
.PHONY: clean
clean:
rm -rf dist/
rm -rf build/
@find $(project) tests -name "*.pyc" -delete
.PHONY: lint
lint:
@$(flake8) $(project) tests examples setup.py
.PHONY: test-lint
test-lint: test lint
.PHONY: docs
docs:
make -C docs html
.PHONY: docsopen
docsopen: docs
open docs/_build/html/index.html
.PHONY: vcr-thrift
vcr-thrift:
make -C ./tchannel/testing/vcr all
.PHONY: gen_thrift
gen_thrift:
thrift --gen py:new_style,slots,dynamic -out tests/data/generated tests/data/idls/ThriftTest.thrift