Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar coverage #463

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c119238
coverage
RagiGeorge Oct 13, 2023
9ef068e
coverage change
RagiGeorge Oct 20, 2023
89dfe44
coverage change
RagiGeorge Oct 20, 2023
db21d61
coverage change
RagiGeorge Oct 20, 2023
e4708ef
coverage change
RagiGeorge Oct 20, 2023
ce7f25d
coverage change
RagiGeorge Oct 20, 2023
fc90028
coverage change
RagiGeorge Oct 20, 2023
ec04993
coverage change
RagiGeorge Oct 20, 2023
11e47a2
coverage change
RagiGeorge Oct 25, 2023
4bd1a3d
coverage change
RagiGeorge Oct 25, 2023
5d344f4
coverage change
RagiGeorge Oct 25, 2023
1cf06e9
coverage change
RagiGeorge Oct 25, 2023
3d6aa25
coverage change
RagiGeorge Oct 25, 2023
9c074c4
coverage change
RagiGeorge Oct 25, 2023
4578b64
coverage change
RagiGeorge Oct 25, 2023
adfb5f4
coverage change
RagiGeorge Oct 25, 2023
0b2762e
coverage change
RagiGeorge Oct 25, 2023
d4f6cfa
coverage change
RagiGeorge Oct 25, 2023
16914f6
coverage change
RagiGeorge Oct 25, 2023
15e423a
coverage change
RagiGeorge Oct 25, 2023
385526e
coverage change
RagiGeorge Oct 25, 2023
38de906
coverage change
RagiGeorge Oct 25, 2023
4af3caa
coverage change
RagiGeorge Oct 25, 2023
4b93ee0
coverage change
RagiGeorge Oct 25, 2023
c44d2db
coverage change
RagiGeorge Oct 25, 2023
68653ad
coverage change
RagiGeorge Oct 25, 2023
57da253
coverage change
RagiGeorge Oct 25, 2023
178727d
coverage change
RagiGeorge Oct 25, 2023
eb2f34c
code coverage
RagiGeorge Oct 26, 2023
c9ee624
code coverage
RagiGeorge Oct 26, 2023
f670a46
code coverage
RagiGeorge Oct 26, 2023
e5909d5
fix: Use SONARQUBE_LOGIN everywhere
Ferenc- Oct 26, 2023
d80f843
code coverage
RagiGeorge Oct 26, 2023
bf7794e
coverage test
RagiGeorge Oct 30, 2023
d171684
coverage test
RagiGeorge Oct 30, 2023
5e08958
coverage test
RagiGeorge Oct 30, 2023
b1e7e7e
coverage test
RagiGeorge Oct 30, 2023
2378856
code coverage
RagiGeorge Oct 30, 2023
0758624
code coverage
RagiGeorge Oct 30, 2023
018ecad
code coverage
RagiGeorge Oct 30, 2023
0404793
code coverage
RagiGeorge Oct 30, 2023
f5d8b8e
code coverage
RagiGeorge Oct 30, 2023
9274dd2
code coverage
RagiGeorge Oct 30, 2023
ce9449d
coverage
RagiGeorge Oct 31, 2023
715ff32
coverage
RagiGeorge Oct 31, 2023
294b7b2
coverage
RagiGeorge Oct 31, 2023
ddd40b2
coverage
RagiGeorge Oct 31, 2023
9e3b418
coverage
RagiGeorge Oct 31, 2023
ff6ecbc
coverage
RagiGeorge Oct 31, 2023
b08d939
coverage
RagiGeorge Oct 31, 2023
298d27c
coverage
RagiGeorge Oct 31, 2023
61d492b
coverage
RagiGeorge Oct 31, 2023
1ef5df6
coverage
RagiGeorge Oct 31, 2023
f53f9d3
coverage
RagiGeorge Oct 31, 2023
e8e4581
coverage
RagiGeorge Oct 31, 2023
6b4e0a3
coverage
RagiGeorge Oct 31, 2023
ecd0a4a
coverage
RagiGeorge Oct 31, 2023
c5ff1e1
coverage
RagiGeorge Oct 31, 2023
65cb601
coverage
RagiGeorge Oct 31, 2023
0f55c50
coverage
RagiGeorge Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,51 @@ commands:
coverage run --source=instana -m pytest -v --junitxml=test-results <<parameters.tests>>
coverage report -m
coverage html
mkdir coverage_results
cp -R .coverage coverage_results/.coverage.${CIRCLE_BUILD_NUM}
cd coverage_results
- persist_to_workspace:
root: .
paths:
- coverage_results

store-pytest-results:
steps:
- store_test_results:
path: test-results
run_sonarqube:
steps:
- attach_workspace:
at: .
- run:
name: Install Java
command: |
sudo apt-get update
sudo apt-get install openjdk-11-jdk
- run:
name: Run SonarQube to report the coverage
command: |
. venv/bin/activate
coverage combine ./coverage_results
coverage xml -i
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472.zip
unzip -d /tmp /tmp/sonar-scanner-cli.zip
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
/tmp/sonar-scanner-4.6.2.2472/bin/sonar-scanner \
-Dsonar.host.url=${SONARQUBE_URL} \
-Dsonar.login="${SONARQUBE_LOGIN}" \
-Dsonar.pullrequest.key="${CIRCLE_PR_NUMBER}" \
-Dsonar.projectKey=Python-Tracer \
-Dsonar.pullrequest.branch="${CIRCLE_BRANCH}"
else
/tmp/sonar-scanner-4.6.2.2472/bin/sonar-scanner \
-Dsonar.host.url=https://sonarqube.instana.io/ \
-Dsonar.login="${SONARQUBE_LOGIN}" \
-Dsonar.projectKey=Python-Tracer \
-Dsonar.branch.name="${CIRCLE_BRANCH}"
fi
store_artifacts:
path: htmlcov

store-coverage-report:
steps:
Expand Down Expand Up @@ -268,6 +308,17 @@ jobs:
- store-pytest-results
- store-coverage-report

final_job:
docker:
- image: cimg/python:3.8.17
working_directory: ~/repo
steps:
- checkout
- pip-install-deps:
requirements: "tests/requirements-307.txt"
- store-pytest-results
- run_sonarqube

py38gevent:
docker:
- image: cimg/python:3.8.17
Expand Down Expand Up @@ -295,3 +346,14 @@ workflows:
- py37cassandra
- py38couchbase
- py38gevent
- final_job:
requires:
- python37
- python38
- python39
- python310
- python311
- python312
- py37cassandra
- py38couchbase
- py38gevent
6 changes: 5 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ sonar.projectName=Python Tracer
sonar.sourceEncoding=utf-8
sonar.sources=.
sonar.exclusions=tests/**/*, example/**/*
sonar.tests=.
sonar.test.inclusions=tests/**/*
sonar.python.coverage.reportPaths=coverage.xml
sonar.links.homepage=https://github.com/instana/python-sensor/
sonar.links.ci=https://circleci.com/gh/instana/python-sensor
sonar.links.issue=https://github.com/instana/python-sensor/issues
sonar.links.scm=https://github.com/instana/python-sensor/
Loading