Skip to content

CLI-179 add network test for install.sh script#121

Open
kirill-knize-sonarsource wants to merge 1 commit intomasterfrom
CLI-179
Open

CLI-179 add network test for install.sh script#121
kirill-knize-sonarsource wants to merge 1 commit intomasterfrom
CLI-179

Conversation

@kirill-knize-sonarsource
Copy link
Member

No description provided.

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Mar 19, 2026

CLI-179

@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 19, 2026

Summary

Adds an integration test that validates the install.sh script works end-to-end, including downloading and executing the sonar CLI binary from binaries.sonarsource.com. The test verifies the binary installs to the correct location and runs successfully on the current platform.

What reviewers should know

This is a new network integration test in tests/integration/specs/install/install-scripts.test.ts. It shells out to the actual install.sh script in user-scripts/ and validates the real download flow. The test has a 120-second timeout to account for network latency. Since it hits the internet, you may want to ensure it runs in a suitable CI environment and consider whether mocking the download would be more appropriate for local test runs.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: The test logic is sound and the path assertions correctly match what install.sh actually does. One genuine concern before this is merge-safe.

🗣️ Give feedback

() => {
const scriptPath = join(scriptDir, 'install.sh');

const scriptContent = readFileSync(scriptPath, 'utf-8');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test downloads the exact version hardcoded in install.sh (version="0.6.1.603", line 76). If install.sh is ever bumped to a new version number before that version's artifacts are published to binaries.sonarsource.com, this test will fail in CI with a 404 or download error.

Is there a CI ordering guarantee that CDN publish always precedes an install.sh version bump landing on the main branch? If not, consider whether the test should skip or be tagged separately from the standard integration suite when run against an unreleased version.

  • Mark as noise

@sonarqubecloud
Copy link

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅

🗣️ Give feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant