diff --git a/.github/workflows/cxx-ci.yml b/.github/workflows/cxx-ci.yml index 1490435fc4..260a0650eb 100644 --- a/.github/workflows/cxx-ci.yml +++ b/.github/workflows/cxx-ci.yml @@ -309,7 +309,7 @@ jobs: java: [ '17' ] distribution: [ 'temurin' ] sonarqube: [ '10.6.0.92116' ] - sonarscanner: [ '5.0.1.3006' ] + sonarscanner: [ '6.1.0.4477' ] runs-on: ${{ matrix.os }} needs: [build-linux, verify-rules] @@ -450,7 +450,7 @@ jobs: java: [ '17' ] distribution: [ 'temurin' ] sonarqube: [ '10.6.0.92116' ] - sonarscanner: [ '5.0.1.3006' ] + sonarscanner: [ '6.1.0.4477' ] runs-on: ${{ matrix.os }} # needs build-linux because of JAR artifacts diff --git a/integration-tests/features/boosttest.feature b/integration-tests/features/boosttest.feature index 4ad8e10de0..855f82dc9e 100644 --- a/integration-tests/features/boosttest.feature +++ b/integration-tests/features/boosttest.feature @@ -35,7 +35,7 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | @@ -57,7 +57,7 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | @@ -78,8 +78,9 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '.*' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/clangtidy.feature b/integration-tests/features/clangtidy.feature index 0479d0caa8..5761dce844 100644 --- a/integration-tests/features/clangtidy.feature +++ b/integration-tests/features/clangtidy.feature @@ -11,7 +11,7 @@ Feature: Importing Clang-Tidy reports And the server log (if locatable) contains no error/warning messages And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the number of violations fed is Examples: diff --git a/integration-tests/features/common.py b/integration-tests/features/common.py index b45525a119..5b065b7c93 100644 --- a/integration-tests/features/common.py +++ b/integration-tests/features/common.py @@ -125,15 +125,11 @@ def analyse_log(logpath, toignore=None): return badlines, errors, warnings def get_url_from_log(lines): - url = '' for line in lines: - if 'INFO: More about the report processing at' in line: - url = line.split('INFO: More about the report processing at')[1].strip() - - if 'INFO - More about the report processing at' in line: - url = line.split('INFO - More about the report processing at')[1].strip() + if 'More about the report processing at' in line: + return line.split('at ')[1].strip() - return url + return '' def analyse_log_lines(lines, toignore=None): badlines = [] diff --git a/integration-tests/features/coverage.feature b/integration-tests/features/coverage.feature index 440995f39a..a7c34ebfe9 100644 --- a/integration-tests/features/coverage.feature +++ b/integration-tests/features/coverage.feature @@ -12,8 +12,9 @@ Feature: Importing coverage data And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -29,7 +30,7 @@ Feature: Importing coverage data And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | @@ -51,9 +52,10 @@ Feature: Importing coverage data And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' - .*WARN.*Cannot find a report for '.*' + .*WARN.*Property 'sonar.cxx.cobertura.reportPaths': cannot find any files.* + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/cppcheck.feature b/integration-tests/features/cppcheck.feature index f7d126c177..cc27a69a79 100644 --- a/integration-tests/features/cppcheck.feature +++ b/integration-tests/features/cppcheck.feature @@ -16,7 +16,7 @@ Feature: Importing Cppcheck reports And the server log (if locatable) contains no error/warning messages But the analysis log contains a line matching """ - WARN: The 'Cppcheck V2' report is empty.*skipping + WARN The 'Cppcheck V2' report is empty.*skipping """ And the number of violations fed is 0 @@ -35,7 +35,7 @@ Feature: Importing Cppcheck reports And the server log (if locatable) contains no error/warning messages But the analysis log contains a line matching """ - WARN: Cannot find the file.*skipping + WARN Cannot find the file 'component1\.cc'.*skipping """ And the number of violations fed is 0 @@ -70,7 +70,7 @@ Feature: Importing Cppcheck reports And the server log (if locatable) contains no error/warning messages But the analysis log contains a line matching """ - WARN: The 'Cppcheck V2' report is invalid.*skipping + WARN The 'Cppcheck V2' report is invalid.*skipping """ And the number of violations fed is Examples: @@ -93,7 +93,7 @@ Feature: Importing Cppcheck reports And the server log (if locatable) contains no error/warning messages And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the number of violations fed is Examples: @@ -116,7 +116,8 @@ Feature: Importing Cppcheck reports And the server log (if locatable) contains no error/warning messages And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* + .*WARN.*Preprocessor:.* """ And the number of violations fed is Examples: diff --git a/integration-tests/features/googletest.feature b/integration-tests/features/googletest.feature index 2042c99aee..606a5ee2a1 100644 --- a/integration-tests/features/googletest.feature +++ b/integration-tests/features/googletest.feature @@ -36,9 +36,10 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -55,7 +56,7 @@ Feature: Providing test execution measures Then the analysis breaks And the analysis log contains a line matching: """ - ERROR: Invalid xUnit report.*stop analysis + ERROR Invalid xUnit report.*stop analysis """ @@ -70,9 +71,10 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -95,11 +97,12 @@ Feature: Providing test execution measures And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' - .*WARN.*The report.*seems to be empty, ignoring\. - .*WARN.*Cannot find a report for '.*' + .*WARN .*The xUnit report.*seems to be empty, ignoring\. + .*WARN.*Property 'sonar\.cxx\.xunit\.reportPaths': cannot find any files.* + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/json-db.feature b/integration-tests/features/json-db.feature index 4df6f7696b..335337bfaa 100644 --- a/integration-tests/features/json-db.feature +++ b/integration-tests/features/json-db.feature @@ -10,7 +10,8 @@ Feature: JSON Compilation Database support And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* + .*ERROR.*preprocessor: /another/include/dir.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/regex.feature b/integration-tests/features/regex.feature index a04d494161..83201ca626 100644 --- a/integration-tests/features/regex.feature +++ b/integration-tests/features/regex.feature @@ -11,7 +11,7 @@ Feature: Regex And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | @@ -28,7 +28,7 @@ Feature: Regex And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | @@ -45,7 +45,7 @@ Feature: Regex And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/smoketest.feature b/integration-tests/features/smoketest.feature index 99bc21d289..6c5941c823 100644 --- a/integration-tests/features/smoketest.feature +++ b/integration-tests/features/smoketest.feature @@ -17,11 +17,12 @@ Feature: Smoketests And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' - .*WARN.*Cannot find the file '.*component_XXX.cc', skipping + .*WARN.*Cannot find the file '.*component_XXX\.cc'.*skipping .*WARN.*Cannot find a report for '.*' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -81,11 +82,12 @@ Feature: Smoketests And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' - .*WARN.*Cannot find the file '.*component_XXX.cc', skipping + .*WARN.*Cannot find the file '.*component_XXX\.cc'.*skipping .*WARN.*Cannot find a report for '.*' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -145,11 +147,12 @@ Feature: Smoketests And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* .*WARN.*cannot find the sources for '#include ' .*WARN.*cannot find the sources for '#include ' - .*WARN.*Cannot find the file '.*component_XXX.cc', skipping + .*WARN.*Cannot find the file '.*component_XXX\.cc'.*skipping .*WARN.*Cannot find a report for '.*' + .*WARN.*Preprocessor:.* """ And the following metrics have following values: | metric | value | @@ -218,12 +221,15 @@ Feature: Smoketests And the analysis in server has completed And the analysis log contains no error/warning messages except those matching: """ - .*WARN.*Unable to get a valid mac address, will use a dummy address - .*WARN.*to create a dependency with 'PathHandling/PathHandle.h' + .*WARN.*The properties 'sonar\.login' and 'sonar\.password' are deprecated and will be removed in the future.* + .*WARN.*to create a dependency with 'PathHandling/PathHandle\.h' .*WARN.*cannot find the sources for '#include ' - .*WARN.*Cannot find the file '.*gtestmock.1.7.2.*', ignoring coverage measures + .*WARN.*Cannot find the file '.*gtestmock\.1\.7\.2.*', ignoring coverage measures .*WARN.*Cannot find a report for '.*' .*WARN.*cannot find the sources for '#include.* + .*WARN.*Preprocessor:.* + .*WARN.*Using absolute path pattern is deprecated.* + .*WARN.*Cannot sanitize file path.* """ And the following metrics have following values: | metric | value | diff --git a/integration-tests/features/steps/test_execution_statistics.py b/integration-tests/features/steps/test_execution_statistics.py index 87c7c27c5a..6bba432f6a 100644 --- a/integration-tests/features/steps/test_execution_statistics.py +++ b/integration-tests/features/steps/test_execution_statistics.py @@ -231,7 +231,7 @@ def step_impl(context): @then('the analysis log contains a line matching') def step_impl(context): - assert _contains_line_matching(context.log, context.text) + assert _contains_line_matching(context.log, context.text), f"The analysis log does not contain a line matching '{context.text}'" @when('I run "{command}"') @@ -241,13 +241,13 @@ def step_impl(context, command): @when('I run sonar-scanner with "{params}"') def step_impl(context, params): - _run_command(context, 'sonar-scanner -Dsonar.login=' + SONAR_LOGIN + ' -Dsonar.password=' + SONAR_PASSWORD + ' ' + params) + _run_command(context, 'sonar-scanner -Dsonar.host.url=http://localhost:9000 -Dsonar.login=' + SONAR_LOGIN + ' -Dsonar.password=' + SONAR_PASSWORD + ' ' + params) @when('I run sonar-scanner with following options') def step_impl(context): arguments = [line for line in context.text.split('\n') if line != ''] - command = 'sonar-scanner -Dsonar.login=' + SONAR_LOGIN + ' -Dsonar.password=' + SONAR_PASSWORD + ' ' + ' '.join(arguments) + command = 'sonar-scanner -Dsonar.host.url=http://localhost:9000 -Dsonar.login=' + SONAR_LOGIN + ' -Dsonar.password=' + SONAR_PASSWORD + ' ' + ' '.join(arguments) _run_command(context, command) @@ -344,7 +344,7 @@ def _run_command(context, command): print('cmd: ' + command, flush=True) with open(context.log, 'r', encoding='utf8') as log: for line in log: - if 'WARN:' in line or 'ERROR:' in line: + if 'WARN' in line or 'ERROR' in line: print(line, flush=True) context.rc = proc.returncode diff --git a/integration-tests/features/webapi.py b/integration-tests/features/webapi.py index 62fce4889c..067f76ee96 100644 --- a/integration-tests/features/webapi.py +++ b/integration-tests/features/webapi.py @@ -34,7 +34,7 @@ def web_api_get(url, log=False): url = SONAR_URL + url response = None if log: - print(f"\n'{url}' response:", flush=True) + print(f"\n'{url}' response:", flush=True) response = requests.get(url, timeout=60, auth=HTTPBasicAuth(SONAR_LOGIN, SONAR_PASSWORD)) response.raise_for_status() if not response.text: