##// END OF EJS Templates
makefile: fixed installing vcsserver for tests
super-admin -
r4967:2c261013 default
parent child Browse files
Show More
@@ -1,153 +1,154 b''
1
1
2 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
2 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
3 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
3 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
4
4
5 NODE_PATH=./node_modules
5 NODE_PATH=./node_modules
6 WEBPACK=./node_binaries/webpack
6 WEBPACK=./node_binaries/webpack
7 GRUNT=./node_binaries/grunt
7 GRUNT=./node_binaries/grunt
8
8
9 .PHONY: clean
9 .PHONY: clean
10 ## Cleanup compiled and cache py files
10 ## Cleanup compiled and cache py files
11 clean:
11 clean:
12 make test-clean
12 make test-clean
13 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
13 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
14
14
15
15
16 .PHONY: test
16 .PHONY: test
17 ## run test-clean and tests
17 ## run test-clean and tests
18 test:
18 test:
19 make test-clean
19 make test-clean
20 make test-only
20 make test-only
21
21
22
22
23 .PHONY:test-clean
23 .PHONY:test-clean
24 ## run test-clean and tests
24 ## run test-clean and tests
25 test-clean:
25 test-clean:
26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
29
29
30
30
31 .PHONY: test-only
31 .PHONY: test-only
32 ## Run tests only without cleanup
32 ## Run tests only without cleanup
33 test-only:
33 test-only:
34 PYTHONHASHSEED=random \
34 PYTHONHASHSEED=random \
35 py.test -x -vv -r xw -p no:sugar \
35 py.test -x -vv -r xw -p no:sugar \
36 --cov-report=term-missing --cov-report=html \
36 --cov-report=term-missing --cov-report=html \
37 --cov=rhodecode rhodecode
37 --cov=rhodecode rhodecode
38
38
39 .PHONY: test-only-mysql
39 .PHONY: test-only-mysql
40 ## run tests against mysql
40 ## run tests against mysql
41 test-only-mysql:
41 test-only-mysql:
42 PYTHONHASHSEED=random \
42 PYTHONHASHSEED=random \
43 py.test -x -vv -r xw -p no:sugar \
43 py.test -x -vv -r xw -p no:sugar \
44 --cov-report=term-missing --cov-report=html \
44 --cov-report=term-missing --cov-report=html \
45 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
45 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
46 --cov=rhodecode rhodecode
46 --cov=rhodecode rhodecode
47
47
48
48
49 .PHONY: test-only-postgres
49 .PHONY: test-only-postgres
50 ## run tests against postgres
50 ## run tests against postgres
51 test-only-postgres:
51 test-only-postgres:
52 PYTHONHASHSEED=random \
52 PYTHONHASHSEED=random \
53 py.test -x -vv -r xw -p no:sugar \
53 py.test -x -vv -r xw -p no:sugar \
54 --cov-report=term-missing --cov-report=html \
54 --cov-report=term-missing --cov-report=html \
55 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
55 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
56 --cov=rhodecode rhodecode
56 --cov=rhodecode rhodecode
57
57
58 .PHONY: docs
58 .PHONY: docs
59 ## build docs
59 ## build docs
60 docs:
60 docs:
61 (cd docs; nix-build default.nix -o result; make clean html)
61 (cd docs; nix-build default.nix -o result; make clean html)
62
62
63
63
64 .PHONY: docs-clean
64 .PHONY: docs-clean
65 ## Cleanup docs
65 ## Cleanup docs
66 docs-clean:
66 docs-clean:
67 (cd docs; make clean)
67 (cd docs; make clean)
68
68
69
69
70 .PHONY: docs-cleanup
70 .PHONY: docs-cleanup
71 ## Cleanup docs
71 ## Cleanup docs
72 docs-cleanup:
72 docs-cleanup:
73 (cd docs; make cleanup)
73 (cd docs; make cleanup)
74
74
75
75
76 .PHONY: web-build
76 .PHONY: web-build
77 ## Build JS packages static/js
77 ## Build JS packages static/js
78 web-build:
78 web-build:
79 NODE_PATH=$(NODE_PATH) $(GRUNT)
79 NODE_PATH=$(NODE_PATH) $(GRUNT)
80
80
81 # check required files
81 # check required files
82 STATIC_CHECK="/robots.txt /502.html \
82 STATIC_CHECK="/robots.txt /502.html \
83 /js/scripts.min.js /js/rhodecode-components.js \
83 /js/scripts.min.js /js/rhodecode-components.js \
84 /css/style.css /css/style-polymer.css /css/style-ipython.css"
84 /css/style.css /css/style-polymer.css /css/style-ipython.css"
85
85
86 for file in $STATIC_CHECK;
86 for file in $STATIC_CHECK;
87 do
87 do
88 if [ ! -f rhodecode/public/$file ]; then
88 if [ ! -f rhodecode/public/$file ]; then
89 echo "Missing $file expected after web-build"
89 echo "Missing $file expected after web-build"
90 exit 1
90 exit 1
91 fi
91 fi
92 done
92 done
93
93
94 .PHONY: pip-packages
94 .PHONY: pip-packages
95 ## show outdated packages
95 ## show outdated packages
96 pip-packages:
96 pip-packages:
97 python ${OUTDATED_PACKAGES}
97 python ${OUTDATED_PACKAGES}
98
98
99
99
100 .PHONY: sdist
100 .PHONY: sdist
101 ## Build sdist
101 ## Build sdist
102 sdist:
102 sdist:
103 python setup.py sdist
103 python setup.py sdist
104
104
105
105
106 .PHONY: dev-env
106 .PHONY: dev-env
107 ## make dev-env based on the requirements files and install develop of packages
107 ## make dev-env based on the requirements files and install develop of packages
108 dev-env:
108 dev-env:
109 pushd ../rhodecode-vcsserver/ && make dev-env && popd
109 pip install -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
110 pip install -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
110 pip install -e .
111 pip install -e .
111
112
112 # Default command on calling make
113 # Default command on calling make
113 .DEFAULT_GOAL := show-help
114 .DEFAULT_GOAL := show-help
114
115
115 .PHONY: show-help
116 .PHONY: show-help
116 show-help:
117 show-help:
117 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
118 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
118 @echo
119 @echo
119 @sed -n -e "/^## / { \
120 @sed -n -e "/^## / { \
120 h; \
121 h; \
121 s/.*//; \
122 s/.*//; \
122 :doc" \
123 :doc" \
123 -e "H; \
124 -e "H; \
124 n; \
125 n; \
125 s/^## //; \
126 s/^## //; \
126 t doc" \
127 t doc" \
127 -e "s/:.*//; \
128 -e "s/:.*//; \
128 G; \
129 G; \
129 s/\\n## /---/; \
130 s/\\n## /---/; \
130 s/\\n/ /g; \
131 s/\\n/ /g; \
131 p; \
132 p; \
132 }" ${MAKEFILE_LIST} \
133 }" ${MAKEFILE_LIST} \
133 | LC_ALL='C' sort --ignore-case \
134 | LC_ALL='C' sort --ignore-case \
134 | awk -F '---' \
135 | awk -F '---' \
135 -v ncol=$$(tput cols) \
136 -v ncol=$$(tput cols) \
136 -v indent=19 \
137 -v indent=19 \
137 -v col_on="$$(tput setaf 6)" \
138 -v col_on="$$(tput setaf 6)" \
138 -v col_off="$$(tput sgr0)" \
139 -v col_off="$$(tput sgr0)" \
139 '{ \
140 '{ \
140 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
141 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
141 n = split($$2, words, " "); \
142 n = split($$2, words, " "); \
142 line_length = ncol - indent; \
143 line_length = ncol - indent; \
143 for (i = 1; i <= n; i++) { \
144 for (i = 1; i <= n; i++) { \
144 line_length -= length(words[i]) + 1; \
145 line_length -= length(words[i]) + 1; \
145 if (line_length <= 0) { \
146 if (line_length <= 0) { \
146 line_length = ncol - indent - length(words[i]) - 1; \
147 line_length = ncol - indent - length(words[i]) - 1; \
147 printf "\n%*s ", -indent, " "; \
148 printf "\n%*s ", -indent, " "; \
148 } \
149 } \
149 printf "%s ", words[i]; \
150 printf "%s ", words[i]; \
150 } \
151 } \
151 printf "\n"; \
152 printf "\n"; \
152 }'
153 }'
153
154
General Comments 0
You need to be logged in to leave comments. Login now