Skip to content

Commit aa4493c

Browse files
authored
Merge pull request #1738 from guwirth/sq-78
test SQ 7.8 support
2 parents d4c5dc9 + 97f3d0b commit aa4493c

12 files changed

+63
-20
lines changed

.travis.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jdk:
77
- oraclejdk8
88

99
env:
10-
- SONARLABEL=sonarqube-6.7.6 SONARAPI=SqApi67
10+
- SONARLABEL=sonarqube-6.7.7 SONARAPI=SqApi67
1111
- SONARLABEL=sonarqube-7.0 SONARAPI=SqApi67
1212
- SONARLABEL=sonarqube-7.1 SONARAPI=SqApi67
1313
- SONARLABEL=sonarqube-7.2 SONARAPI=SqApi67
@@ -16,7 +16,8 @@ env:
1616
- SONARLABEL=sonarqube-7.5 SONARAPI=SqApi75
1717
- SONARLABEL=sonarqube-7.6 SONARAPI=SqApi76
1818
- SONARLABEL=sonarqube-7.7 SONARAPI=SqApi76
19-
19+
- SONARLABEL=sonarqube-7.8 SONARAPI=SqApi78
20+
2021
matrix:
2122
fast_finish: true
2223
# allow_failures:
@@ -52,8 +53,8 @@ install:
5253
- pushd /tmp
5354
- wget -nv --timeout=10 https://binaries.sonarsource.com/Distribution/sonarqube/$SONARLABEL.zip
5455
- unzip -qq $SONARLABEL.zip
55-
- wget -nv --timeout=10 https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492.zip
56-
- unzip -qq sonar-scanner-cli-3.3.0.1492.zip
56+
- wget -nv --timeout=10 https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744.zip
57+
- unzip -qq sonar-scanner-cli-4.0.0.1744.zip
5758
- wget -nv --timeout=10 https://github.com/htacg/tidy-html5/archive/5.6.0.zip --output-document=tidy-html5.zip
5859
- unzip -qq tidy-html5.zip
5960
- pushd tidy-html5-5.6.0/build/cmake/
@@ -71,8 +72,11 @@ script:
7172
- mvn install -B -e -V -DskipTests=true
7273
- mvn test -B -e -V
7374
- bash cxx-sensors/src/tools/check_rules.sh
74-
- RAILS_ENV=production PATH=$PATH:/tmp/sonar-scanner-3.3.0.1492/bin TestDataFolder=~/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata behave --no-capture --tags=$SONARAPI
75+
- RAILS_ENV=production PATH=$PATH:/tmp/sonar-scanner-4.0.0.1744/bin TestDataFolder=~/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata behave --no-capture --tags=$SONARAPI
7576

7677
after_failure:
7778
- cat $SONARHOME/logs/sonar.log
79+
- cat $SONARHOME/logs/web.log
80+
- cat $SONARHOME/logs/ce.log
81+
- cat $SONARHOME/logs/es.log
7882
- find . -name "*.log" | xargs cat

cxx-sensors/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>com.fasterxml.jackson.core</groupId>
6767
<artifactId>jackson-databind</artifactId>
68-
<version>2.9.8</version>
68+
<version>2.9.9</version>
6969
</dependency>
7070
<dependency>
7171
<groupId>com.googlecode.plist</groupId>

integration-tests/features/importing_clangsa_reports.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SqApi67 @SqApi75 @SqApi76
1+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
22
Feature: Importing Clang Static Analyzer reports
33
As a SonarQube user,
44
I want to import the Clang Static Analyzer reports into SonarQube.

integration-tests/features/importing_clangsa_scanbuild_reports.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SqApi67 @SqApi75 @SqApi76
1+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
22
Feature: Importing Clang Static Analyzer scan-build reports
33

44
As a SonarQube user,

integration-tests/features/importing_coverage.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Importing coverage data
33
I want to import my coverage metric values into SonarQube
44
In order to be able to use relevant SonarQube features
55

6-
@SqApi67 @SqApi75 @SqApi76
6+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
77
Scenario: Importing coverage reports
88
Given the project "coverage_project"
99
When I run sonar-scanner with following options:
@@ -23,7 +23,7 @@ Feature: Importing coverage data
2323
| line_coverage | 25.0 |
2424
| branch_coverage | 50 |
2525

26-
@SqApi67 @SqApi75 @SqApi76
26+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
2727
Scenario: Zero coverage measures without coverage reports
2828
If we don't pass coverage reports all coverage measures, except the branch
2929
ones, should be 'zero'. The branch coverage measures remain 'None'

integration-tests/features/importing_cppcheck_reports.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Importing Cppcheck reports
44
In order to have all static code checking results in one place,
55
work with them, filter them etc. and derive metrics from them.
66

7-
@SqApi67 @SqApi75 @SqApi76
7+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
88
Scenario: The reports are missing
99
Given the project "cppcheck_project"
1010
When I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=empty.xml"
@@ -30,7 +30,7 @@ Feature: Importing Cppcheck reports
3030
"""
3131
And the number of violations fed is 0
3232

33-
@SqApi67 @SqApi75 @SqApi76
33+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
3434
Scenario: The reports use paths relative to directories listed in sonar.sources
3535
Given the project "cppcheck_project"
3636
When I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=relative-to-src.xml"
@@ -43,7 +43,7 @@ Feature: Importing Cppcheck reports
4343
"""
4444
And the number of violations fed is 0
4545

46-
@SqApi67 @SqApi75 @SqApi76
46+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
4747
Scenario: The reports and issues in the reports have absolute paths
4848
Given the project "cppcheck_with_absolute_paths_project"
4949
And platform is not "Windows"
@@ -53,7 +53,7 @@ Feature: Importing Cppcheck reports
5353
And the server log (if locatable) contains no error/warning messages
5454
And the number of violations fed is 6
5555

56-
@SqApi67 @SqApi75 @SqApi76
56+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
5757
Scenario Outline: The reports are invalid
5858
Given the project "cppcheck_project"
5959
When I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"
@@ -70,7 +70,7 @@ Feature: Importing Cppcheck reports
7070
| unparsable.xml | 0 |
7171
| wrongly_encoded.xml | 0 |
7272

73-
@SqApi67 @SqApi75 @SqApi76
73+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
7474
Scenario Outline: Importing Cppcheck reports
7575
Given the project "cppcheck_project"
7676
When I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"

integration-tests/features/multimodule_analysis.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SqApi67 @SqApi75 @SqApi76
1+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
22
Feature: cpp-multimodule-project
33
Test multimodule project with reports at root of the project
44

integration-tests/features/smoketest.feature

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,42 @@ Feature: Smoketest
119119
| test_failures | 2 |
120120
| test_errors | 0 |
121121
| tests | 4 |
122+
123+
@SqApi78
124+
Scenario: Smoketest
125+
Given the project "smoketest_project"
126+
When I run "sonar-scanner -X"
127+
Then the analysis finishes successfully
128+
And the analysis in server has completed
129+
And the analysis log contains no error/warning messages except those matching:
130+
"""
131+
.*WARN.*Unable to get a valid mac address, will use a dummy address
132+
.*WARN.*cannot find the sources for '#include <gtest/gtest\.h>'
133+
.*WARN.*cannot find the sources for '#include <iostream>'
134+
.*WARN.*Cannot find the file '.*component_XXX.cc', skipping violations
135+
.*WARN.*Cannot find a report for '.*'
136+
.*WARN.*Already created edge from 'src/cli/main.cc'.*
137+
"""
138+
And the following metrics have following values:
139+
| metric | value |
140+
| ncloc | 56 |
141+
| lines | 151 |
142+
| statements | 36 |
143+
| classes | 1 |
144+
| files | 8 |
145+
| functions | 5 |
146+
| comment_lines_density | 30 |
147+
| comment_lines | 24 |
148+
| duplicated_lines_density | 55.6 |
149+
| duplicated_lines | 84 |
150+
| duplicated_blocks | 2 |
151+
| duplicated_files | 2 |
152+
| complexity | 7 |
153+
| file_complexity | 0.9 |
154+
| violations | 12 |
155+
| coverage | 53.8 |
156+
| line_coverage | 54.8 |
157+
| branch_coverage | 50 |
158+
| test_failures | 2 |
159+
| test_errors | 0 |
160+
| tests | 4 |

integration-tests/features/test_create_rules_and_bullseye_import.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SqApi67 @SqApi75 @SqApi76
1+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
22
Feature: GoogleTestWithBullseyeAndVsProject
33
This test verifies that analysis is able to import bullseye coverage reports and import custom rules reports.
44
Custom rules are created using Rest API, after test ends rules are deleted.

integration-tests/features/test_execution_statistics.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SqApi67 @SqApi75 @SqApi76
1+
@SqApi67 @SqApi75 @SqApi76 @SqApi78
22
Feature: Providing test execution numbers
33
As a SonarQube user,
44
I want to import the test execution reports into SonarQube

0 commit comments

Comments
 (0)