-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
55 lines (42 loc) · 1.91 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
TRIAL ?= trial
sdist:
python3 setup.py sdist
test: test-psql test-mysql test-sqlite lint
make test-clean
lint:
pycodestyle --ignore=E501,W503 ./bley ./setup.py
test-sqlite: test-setup-sqlite
$(TRIAL) $(TRIAL_FLAGS) test/test_*.py
-[ ! -f ./test/bley_test.pid ] || kill $$(cat ./test/bley_test.pid)
bleygraph -c ./test/bley_sqlite.conf -d ./test/bleygraphout
make test-clean
test-setup-sqlite: test-clean
sed "s#.*DBPORT##;s#DBTYPE#sqlite3#;s#DBNAME#./test/bley_sqlite.db#" ./test/bley_test.conf.in > ./test/bley_sqlite.conf
bley -c ./test/bley_sqlite.conf -p ./test/bley_test.pid
test-psql:
pg_virtualenv make test-psql-real
test-psql-real: test-setup-psql
$(TRIAL) $(TRIAL_FLAGS) test/test_*.py
-[ ! -f ./test/bley_test.pid ] || kill $$(cat ./test/bley_test.pid)
bleygraph -c ./test/bley_psql.conf -d ./test/bleygraphout
make test-clean
test-setup-psql: test-clean
sed "s#DBHOST#$$PGHOST#;s#DBPORT#$$PGPORT#;s#DBUSER#$$PGUSER#;s#DBPASS#$$PGPASSWORD#;s#DBTYPE#pgsql#;s#DBNAME#bley_test#" ./test/bley_test.conf.in > ./test/bley_psql.conf
createdb bley_test
bley -c ./test/bley_psql.conf -p ./test/bley_test.pid
test-mysql:
my_virtualenv make test-mysql-real
test-mysql-real: test-setup-mysql
$(TRIAL) $(TRIAL_FLAGS) test/test_*.py
-[ ! -f ./test/bley_test.pid ] || kill $$(cat ./test/bley_test.pid)
bleygraph -c ./test/bley_mysql.conf -d ./test/bleygraphout
make test-clean
test-setup-mysql: test-clean
sed "s#DBHOST#$$MYSQL_HOST#;s#DBPORT#$$MYSQL_TCP_PORT#;s#DBUSER#$$MYSQL_USER#;s#DBPASS#$$MYSQL_PWD#;s#DBTYPE#mysql#;s#DBNAME#bley_test#" ./test/bley_test.conf.in > ./test/bley_mysql.conf
echo "CREATE DATABASE bley_test;" | mysql
bley -c ./test/bley_mysql.conf -p ./test/bley_test.pid
test-clean:
-[ ! -f ./test/bley_test.pid ] || kill $$(cat ./test/bley_test.pid)
rm -f ./test/bley_sqlite.db ./test/bley_sqlite.conf ./test/bley_psql.conf ./test/bley_mysql.conf
rm -rf ./test/bleygraphout/
.PHONY: sdist test