1DIST_DIR=./dist
2DIRS=b conf lib longevity pytests resources scripts unittests
3FILES=Makefile README TestInput.py
4SLEEP_TIME=3
5VERBOSE=0
6TESTNAME=conf/py-all-dev.conf
7
8.PHONY: clean testrunner test test-quick
9
10testrunner:
11	mkdir -p $(DIST_DIR)/testrunner
12	tar -cvf $(DIST_DIR)/testrunner.tar --exclude='*.pyc' $(DIRS) $(FILES)
13	tar -C $(DIST_DIR)/testrunner -xvf $(DIST_DIR)/testrunner.tar
14	rm -f $(DIST_DIR)/testrunner.tar
15	tar -C $(DIST_DIR) -czvf $(DIST_DIR)/testrunner.tar.gz testrunner
16
17clean:
18	rm -rf $(DIST_DIR)
19
20test:
21	scripts/start_cluster_and_run_tests.sh b/resources/dev.ini $(TESTNAME)
22
23simple-test:
24	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes-xdcr.ini conf/simple.conf $(VERBOSE)
25
26dcp-test:
27	python testrunner.py -i b/resources/dev-4-nodes.ini -c conf/py-dcp.conf -p skip_cleanup=False,dev=True,test=$(TEST)
28
29simple-test-ng:
30	python scripts/start_cluster_and_run_tests.py $(MAKE) b/resources/dev-4-nodes-xdcr.ini conf/simple.conf $(VERBOSE)
31
32#test-views:
33#	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/py-view.conf
34test-viewquery:
35	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/view-conf/py-viewquery.conf
36
37# required before merging changes to view engine
38test-views-pre-merge:
39	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/view-conf/py-view-pre-merge.conf
40
41# required before merging changes to view engine
42test-viewmerge:
43	echo "Running view merge tests with single node cluster"
44	scripts/start_cluster_and_run_tests.sh b/resources/dev-single-node.ini conf/view-conf/py-viewmerge.conf
45	echo "Running view merge tests with 4 nodes cluster"
46	sleep $(SLEEP_TIME)
47	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/view-conf/py-viewmerge.conf
48
49e2e-kv-single-node:
50	scripts/start_cluster_and_run_tests.sh b/resources/dev.ini conf/py-all-dev.conf
51
52test-xdcr-merge:
53	scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes-xdcr.ini conf/py-xdcrmerge.conf
54
55# specify number of nodes and testcase
56any-test:
57	scripts/start_cluster_and_run_tests.sh $(NODES) $(TEST)
58
59# specify number of nodes and test conf
60any-suite:
61	scripts/start_cluster_and_run_tests.sh $(NODES) $(SUITE)
62