Skip to content

CLI-60 CLI-61 Add integration tests and a harness#65

Merged
damien-urruty-sonarsource merged 18 commits intomasterfrom
experiment/kk/test-harness-ideas
Mar 9, 2026
Merged

CLI-60 CLI-61 Add integration tests and a harness#65
damien-urruty-sonarsource merged 18 commits intomasterfrom
experiment/kk/test-harness-ideas

Conversation

@kirill-knize-sonarsource
Copy link
Member

No description provided.

@kirill-knize-sonarsource kirill-knize-sonarsource force-pushed the experiment/kk/test-harness-ideas branch from 0dde98b to ca1452f Compare March 3, 2026 14:47
@sonarqube-agent
Copy link

sonarqube-agent bot commented Mar 3, 2026

Remediation Agent Summary 📊

🤖 To review: The 4 issues found require manual fixes.
Issues requiring manual fix (4)

QualityIssueStatus
Maintainability
🟠 Medium
Merge this if statement with the nested one.

Why is this an issue?


Unresolved
Maintainability
🟡 Low
Unexpected negated condition.

Why is this an issue?


Unresolved
Maintainability
🟡 Low
Prefer using nullish coalescing operator (`??`) instead of a ternary expression, as it is simpler to read.

Why is this an issue?


Unresolved
Maintainability
🟡 Low
Unexpected negated condition.

Why is this an issue?


Unresolved

Note

Help us improve the Agent!
Have a suggestion or found an issue? Share your feedback here.

@damien-urruty-sonarsource damien-urruty-sonarsource force-pushed the experiment/kk/test-harness-ideas branch 2 times, most recently from 5ae9de0 to f37b0c9 Compare March 3, 2026 17:16
@kirill-knize-sonarsource kirill-knize-sonarsource force-pushed the experiment/kk/test-harness-ideas branch 2 times, most recently from 96f12d6 to 1810f95 Compare March 4, 2026 10:17
@damien-urruty-sonarsource damien-urruty-sonarsource force-pushed the experiment/kk/test-harness-ideas branch 2 times, most recently from 69818bf to 566d094 Compare March 7, 2026 10:09
kirill-knize-sonarsource and others added 16 commits March 9, 2026 12:06
This allows not having a separate env var to support for tests, and no specific logic in the production code, we get homedir() from node. The harness takes care of creating a fake temp home dir and setting the appropriate env vars passed when running the process, HOME and USERPROFILE (Windows)
Download secrets as a test resource, it can later be injected in each test via the harness
@kirill-knize-sonarsource kirill-knize-sonarsource force-pushed the experiment/kk/test-harness-ideas branch 3 times, most recently from 254d9a1 to f203eac Compare March 9, 2026 13:22
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

SonarQube reviewer guide

Review in SonarQube

Summary: Adds a comprehensive integration testing harness with fake SonarQube/binaries servers, setup scripts, and resource downloads. Includes 400+ new integration tests covering auth, install, list, integrate, and analyze commands. Refactors build scripts, package.json test commands, and updates internal APIs.

Review Focus:

  • Critical: New setup-integration-resources.ts — downloads real sonar-secrets binary & signature for offline testing. Verify download URL logic and PGP verification are correct.
  • Critical: File-based keychain (SONAR_CLI_KEYCHAIN_FILE env var) — new feature for test isolation. Check src/lib/keychain.ts for createFileKeytar() implementation.
  • Important: src/cli/commands/list.tsresolveAuth() call moved after validation. Verify auth flow still works correctly.
  • Important: Test harness design — 5 new helper files. Review fake-sonarqube-server.ts and cli-runner.ts for process spawning and loopback OAuth token delivery.
  • Large: 600+ lines of integration tests in specs/. Spot-check a few test files to ensure assertions are realistic.

Start review at: `build-scripts/setup

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@kirill-knize-sonarsource kirill-knize-sonarsource changed the title [DON'T MERGE] Harness ideas CLI-60 Test harness framework Mar 9, 2026
@kirill-knize-sonarsource kirill-knize-sonarsource changed the title CLI-60 Test harness framework CLI-60 CLI-61 Test harness framework Mar 9, 2026
@damien-urruty-sonarsource damien-urruty-sonarsource changed the title CLI-60 CLI-61 Test harness framework CLI-60 CLI-61 Add integration tests and a harness Mar 9, 2026
@damien-urruty-sonarsource damien-urruty-sonarsource merged commit c87c0ef into master Mar 9, 2026
11 checks passed
@damien-urruty-sonarsource damien-urruty-sonarsource deleted the experiment/kk/test-harness-ideas branch March 9, 2026 14:42
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.

2 participants