[ci-fix] test: mock secrets binary in analyze-skips-agentic test to prevent Windows hook timeout#432
Draft
github-actions[bot] wants to merge 1 commit into
Conversation
…ndows hook timeout The 'exits with code 0 and skips agentic gracefully for the bare analyze command when no project is configured' test was failing on Windows with 'a beforeEach/afterEach hook timed out'. The bare analyze command calls analyzeSecrets() on the change set. Without withSecretsBinaryInstalled(), the CLI tries to download the real sonar-secrets binary from binaries.sonarsource.com during the test. On Windows CI, this download (or the subsequent cleanup of the freshly-written binary file) causes harness.dispose() in afterEach to exceed Bun's default hook timeout. Add withSecretsBinaryInstalled() so the pre-built mock binary is used instead, matching the pattern of other tests in the same describe block that exercise the bare analyze command. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Deploy Preview for sonarqube-cli canceled.
|
1 similar comment
✅ Deploy Preview for sonarqube-cli canceled.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Diagnosis
Category: Flaky / transient — Windows
afterEachhook timeout caused by real binary downloadThe
Integration and E2E Tests - windowsjob in Build run #27271275740 failed on commit51b393e(CLI-646 Add --project option to 'sonar analyze') with:Root Cause
The bare
analyzecommand callsanalyzeSecrets()on the resolved change set. The test creates an untracked file (app.ts) so the change set is non-empty, triggeringinstallSecretsBinary()which attempts to download the realsonar-secretsbinary frombinaries.sonarsource.com.On Windows CI, this download (or the subsequent cleanup of the freshly-written binary file) causes
harness.dispose()insideafterEachto exceed Bun's default hook timeout — even though the test body itself completes and its assertions pass.Fix
Add
withSecretsBinaryInstalled()to the test's setup so the pre-built mock binary (fromtests/integration/resources/dependency-artifacts/) is used instead of downloading the real one. This matches the pattern already used by all other tests in the samedescribeblock that exercise the bareanalyzecommand.File changed:
tests/integration/specs/analyze/analyze-sqaa.test.tsTriggering failure
51b393eby damien-urruty-sonarsource — "CLI-646 Add --project option to 'sonar analyze' (CLI-646 Add --project option to 'sonar analyze' #431)"