File tree Expand file tree Collapse file tree 3 files changed +133
-50
lines changed
Expand file tree Collapse file tree 3 files changed +133
-50
lines changed Original file line number Diff line number Diff line change @@ -5,38 +5,57 @@ functions:
55 params :
66 directory : sonar
77
8- tests_unit :
9- # 1. Create virtualenv
10- - command : subprocess.exec
8+ python_venv : &python_venv
9+ command : subprocess.exec
1110 type : setup
1211 params :
1312 command : virtualenv --python /opt/python/3.7/bin/python3 ./venv
14- # 2. Install dependencies
15- - command : subprocess.exec
13+
14+ python_requirements : &python_requirements
15+ command : subprocess.exec
1616 type : setup
1717 params :
1818 working_dir : sonar
19- command : ${workdir}/venv/bin/python -m pip install -r requirements.txt --quiet --no-warn-script-location
20- # 3. Install sonar package
21- - command : subprocess.exec
19+ command : ${workdir}/venv/bin/python -m pip install -r requirements-dev.txt --quiet --no-warn-script-location
20+
21+ sonar_install : &sonar_install
22+ command : subprocess.exec
2223 type : setup
2324 params :
2425 working_dir : sonar
2526 command : ${workdir}/venv/bin/python setup.py install
26- # 4. Run pytest
27+
28+ tests_unit :
29+ - *python_venv
30+ - *python_requirements
31+ - *sonar_install
2732 - command : subprocess.exec
2833 type : test
2934 params :
3035 working_dir : sonar
3136 command : ${workdir}/venv/bin/python -m pytest
3237
38+ tests_lint :
39+ - *python_venv
40+ - *python_requirements
41+ - command : subprocess.exec
42+ type : test
43+ params :
44+ working_dir : sonar
45+ command : ${workdir}/venv/bin/python -m pylint sonar/ --fail-under=8
46+
3347tasks :
3448- name : tests_unit
3549 tags : ["tests"]
3650 commands :
3751 - func : fetch_source
3852 - func : tests_unit
3953
54+ - name : tests_lint
55+ tags : ["tests"]
56+ commands :
57+ - func : fetch_source
58+ - func : tests_lint
4059
4160buildvariants :
4261- name : tests_unit
@@ -46,3 +65,4 @@ buildvariants:
4665 stepback : true
4766 tasks :
4867 - name : tests_unit
68+ - name : tests_lint
Original file line number Diff line number Diff line change 44black
55flake8
66autopep8
7+ pylint == 2.6.0
You can’t perform that action at this time.
0 commit comments