Skip to content

Commit

Permalink
SQ-10: test with SonarScanner 6.1.0.4477
Browse files Browse the repository at this point in the history
There was a braking change in scanner parameter sonar.host.url:
- For SonarScanner CLI from v6.0, .NET from v7.0, and NPM from v4.0:  https://sonarcloud.io
- For older versions of the SonarScanner CLI, .NET, and NPM:  http://localhost:9000

got the message below:

06:50:43.753 INFO  Scanner configuration file: /home/runner/work/sonar-cxx/sonar-cxx/test/sonar-scanner-6.1.0.4477/conf/sonar-scanner.properties
06:50:43.756 INFO  Project root configuration file: /home/runner/work/sonar-cxx/sonar-cxx/integration-tests/testdata/boosttest_project/sonar-project.properties
06:50:43.769 INFO  SonarScanner CLI 6.1.0.4477
06:50:43.772 INFO  Java 17.0.12 Eclipse Adoptium (64-bit)
06:50:43.772 INFO  Linux 6.5.0-1025-azure amd64
06:50:43.779 DEBUG Scanner max available memory: 3 GB
06:50:43.797 DEBUG uname -m returned 'x86_64'
06:50:43.798 DEBUG Create: /home/runner/.sonar/cache
06:50:43.799 INFO  User cache: /home/runner/.sonar/cache
06:50:43.799 DEBUG Create: /home/runner/.sonar/cache/_tmp
06:50:44.107 DEBUG Loaded [413] system trusted certificates
06:50:44.253 INFO  JRE provisioning: os[linux], arch[x86_64]
06:50:44.279 DEBUG --> GET https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64
06:50:45.445 DEBUG <-- 401 https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64 (1165ms, 83-byte body)
06:50:45.445 INFO  EXECUTION FAILURE
06:50:45.446 INFO  Total time: 1.694s
06:50:45.447 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Error status returned by url [https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64]: 401
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:182)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.callApi(ServerConnection.java:145)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.callRestApi(ServerConnection.java:123)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreMetadata(JavaRunnerFactory.java:159)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:138)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:85)
	at org.sonarsource.scanner.lib.internal.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:53)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:118)
	at org.sonarsource.scanner.cli.Main.analyze(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
  • Loading branch information
guwirth committed Aug 16, 2024
1 parent 776c530 commit 5eced32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cxx-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/features/steps/test_execution_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 5eced32

Please sign in to comment.