CLI-289 Coverage experiment: sonar ping command covered by integration tests#173
CLI-289 Coverage experiment: sonar ping command covered by integration tests#173kirill-knize-sonarsource wants to merge 1 commit intomasterfrom
Conversation
SummaryThis PR adds a new What reviewers should knowFiles to review:
Note on test coverage: This PR is labeled a "coverage experiment" and includes integration tests only. The command has no unit tests — validation happens through the full integration test harness with a fake SonarQube server.
|
|
| const client = new SonarQubeClient(auth.serverUrl, auth.token); | ||
| const status = await client.getSystemStatus(); |
There was a problem hiding this comment.
Bug: getSystemStatus() calls /api/system/status, which is a SonarQube Server endpoint. The login.ts command explicitly guards against calling it on cloud connections (else if (!isCloud)) for the same reason.
ResolvedAuth already carries auth.connectionType: 'cloud' | 'on-premise', so the fix is straightforward — either reject cloud connections with a clear error, or query a cloud-appropriate endpoint instead.
| const client = new SonarQubeClient(auth.serverUrl, auth.token); | |
| const status = await client.getSystemStatus(); | |
| if (auth.connectionType === 'cloud') { | |
| throw new CommandFailedError( | |
| 'sonar ping is not supported for SonarQube Cloud connections.', | |
| ); | |
| } | |
| const client = new SonarQubeClient(auth.serverUrl, auth.token); | |
| const status = await client.getSystemStatus(); |
- Mark as noise



No description provided.