Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abce191

Browse files
authored
Merge pull request #223 from jgebal/testing_sonar
Fixed sonar analysis, improved coveralls to be more pesimistic on coverage
2 parents 8734716 + 3ab5c9b commit abce191

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ addons:
1313
- oracle-java8-set-default
1414
sonarqube:
1515
token:
16-
secure: AmQdR1Fm0tvA9Ees1wz1RqnUl49lZrGdhWCkx7SnIzz+/1Lm2L9aH/e4bL60wIqkJ+AK8tJ1YX4L2B+i7/t5dBSH9Nj8JgbJFwHMqHdMCmaqKpvT5eJRzhbgr0kccm8ECHWTWBL+mIyXXYUm4f/tuRnnngfZS/bxtUpFUDvotcEybuuGUvKSbmc6ew5tfBuX79G/lXbFBceO6EQStoi8SeIHDkgeX/BoQQin0BFVMcsuWKPuQ5P5B19KfxubEk6tiHLZffoaF1q+RbsFcwpr4nyXHiusTRdtLmHb5DvlSQsy15qaakJP6AA073sGjnKxcGiGvP48HbC07tQmtBiZY2Ybkqj9i4aRq0hzX/VXRuZOV/rQARjItS4MKTmD9gET9XkYzc/P8VxSGRFT97guF3f6qtPzcGCu3TbFQpgeP+mgcePLvDl5j/AL+tZAAwSj3mPhEGncr5j+QkcLhl+mM5TymNeJn828qb8I7+mSdqbmPwytc//hwJLeqFJDX2GGnXZD4VkMZDvUO6gq2bQXy0hLgdI7uIQpIzIUlAGoYG6MK4SuHxnx+ZNwsW/nrMGVCJrK67Ii/R++Fg4et5QshTaTbkcQ3Deroady/pnGwlD5FR59LYpjqOVQ+4ey2bf92eGx0j0NWCz+CfirKSXd3o1hESSqamyi8KtOqkqiLEg=
17-
16+
secure: ${SONAR_TOKEN}
17+
branches:
18+
- develop
19+
- master
1820
env:
1921
global:
2022
- ORACLE_COOKIE=sqldev
@@ -69,7 +71,7 @@ script:
6971
# - bash .travis/build_docs.sh
7072
# - bash .travis/push_docs_to_gh_pages.sh
7173
- sonar-scanner
72-
- bash .travis/coveralls_uploader.sh
74+
- bash .travis/coveralls_uploader.sh
7375

7476
deploy:
7577
provider: releases

sonar-project.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues
1414
sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL
1515
sonar.links.homepage=https://github.com/utPLSQL/utPLSQL
1616
sonar.projectDescription=PL/SQL Unit Testing Framework
17+
sonar.plsql.file.suffixes=sql,tab,pkb,tpb
18+
sonar.language=plsql
1719

1820
# Encoding of the source code. Default is default system encoding
1921
#sonar.sourceEncoding=UTF-8

source/reporters/ut_coverage_sonar_reporter.tpb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ create or replace type body ut_coverage_sonar_reporter is
8484
function get_lines_xml(a_unit_coverage ut_coverage.t_unit_coverage) return clob is
8585
l_file_part varchar2(32767);
8686
l_result clob;
87-
c_no_lines constant varchar2(30) := '<lineToCover/>'||chr(10);
8887
l_line_no binary_integer;
8988
begin
9089
dbms_lob.createtemporary(l_result, true);
9190
l_line_no := a_unit_coverage.lines.first;
9291
if l_line_no is null then
93-
dbms_lob.writeappend(l_result, length(c_no_lines), c_no_lines);
92+
for i in 1 .. a_unit_coverage.total_lines loop
93+
l_file_part := '<lineToCover lineNumber="'||i||'" covered="false"/>'||chr(10);
94+
dbms_lob.writeappend(l_result, length(l_file_part), l_file_part);
95+
end loop;
9496
else
9597
while l_line_no is not null loop
9698
l_file_part :=

source/reporters/ut_coveralls_reporter.tpb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ create or replace type body ut_coveralls_reporter is
9393
dbms_lob.writeappend(l_result, length(c_coverage_header), c_coverage_header);
9494

9595
l_last_line_no := a_unit_coverage.lines.last;
96-
if l_last_line_no is not null then
96+
if l_last_line_no is null then
97+
l_last_line_no := a_unit_coverage.total_lines - 1;
98+
for i in 1 .. l_last_line_no loop
99+
dbms_lob.writeappend(l_result, 2, '0,');
100+
end loop;
101+
dbms_lob.writeappend(l_result, 1, '0');
102+
else
97103
for line_no in 1 .. l_last_line_no loop
98104
l_file_part :=
99105
case

0 commit comments

Comments
 (0)