Skip to content

Commit 2d9a7a3

Browse files
chore: integrate with sonarcloud (twilio#571)
* chore: integrate with sonarcloud
1 parent f47a753 commit 2d9a7a3

5 files changed

+26
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pip-log.txt
2020
# Unit test / coverage reports
2121
.coverage
2222
.tox
23+
coverage.xml
2324

2425
.DS_Store
2526

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ python:
1010
- '3.9'
1111
services:
1212
- docker
13+
jobs:
14+
include:
15+
- language: python
16+
python: '3.9'
17+
after_success:
18+
- sonar-scanner
1319
install:
1420
- pip install virtualenv --upgrade
1521
- make install
@@ -19,6 +25,7 @@ script:
1925
- if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
2026
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin;
2127
fi
28+
- make cover
2229
deploy:
2330
- provider: script
2431
script: make docker-build && make docker-push

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ test: analysis
2424

2525
cover:
2626
. venv/bin/activate; \
27-
find tests -type d | xargs nosetests --with-coverage --cover-inclusive --cover-erase --cover-package=twilio
27+
find tests -type d | xargs nosetests --with-coverage --cover-inclusive --cover-erase --cover-package=twilio; \
28+
coverage xml --omit 'twilio/rest/*' -o coverage.xml
2829

2930
docs-install:
3031
. venv/bin/activate; pip install -r tests/requirements.txt

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ nose
44
six
55
requests>=2.0.0
66
PyJWT==1.7.1
7-
twine
7+
twine

sonar-project.properties

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sonar.projectKey=twilio_twilio-python
2+
sonar.projectName=twilio-python
3+
sonar.organization=twilio
4+
5+
sonar.sources=twilio/
6+
# Exclude any auto-generated source code
7+
sonar.exclusions=twilio/rest/**/*
8+
sonar.tests=tests/
9+
# Exclude any auto-generated integration tests
10+
sonar.test.exclusions=tests/integration/**/test_*.py
11+
12+
# For Code Coverage analysis
13+
sonar.python.coverage.reportPaths=coverage.xml
14+
# Exclude auto-generated code from coverage analysis
15+
sonar.coverage.exclusions=twilio/rest/**/*

0 commit comments

Comments
 (0)