[quality] tests: add selfUpdateFallback coverage via injectable execReplaceFunc#20557
[quality] tests: add selfUpdateFallback coverage via injectable execReplaceFunc#20557kubestellar-hive[bot] wants to merge 3 commits into
Conversation
…eplaceFunc Adds 3 table-free unit tests for pkg/agent/updater.selfUpdateFallback, the last 0%-coverage function in #20478 not already addressed by open PRs (#20486, #20545). - Extracts ExecReplace into package-level var execReplaceFunc so tests can override it without actually re-execing the test binary (which would replace the running process on Unix via syscall.Exec). - Tests verify: killBackend/restartBackend are called, exec proceeds after restartBackend error, and the current binary path is forwarded. Fixes #20478 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: scanner-bot <scanner-bot@kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole canceled.
|
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
🚫 Scanner Merge Guardrails: Rate Limit ExceededThis PR cannot be auto-merged because the scanner has already merged 5 PRs in the last hour. Rate Limit: 3 merges per hour Reason: This guardrail prevents rapid consecutive merges that can cause build instability. See issue #18218 for context. |
Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@users.noreply.github.com>
🚫 Scanner Merge Guardrails: Rate Limit ExceededThis PR cannot be auto-merged because the scanner has already merged 4 PRs in the last hour. Rate Limit: 3 merges per hour Reason: This guardrail prevents rapid consecutive merges that can cause build instability. See issue #18218 for context. |
Signed-off-by: kubestellar-hive[bot] <andan02@gmail.com>
Summary
Fixes the last 0%-coverage function in
pkg/agent/updaternot already addressed by open PRs (#20486 covers gitStash/gitStashPop, #20545 covers downloadFile).Changes
pkg/agent/updater/build.go: ExtractsExecReplaceinto a package-levelexecReplaceFuncvariable so tests can override it without triggeringsyscall.Exec(which would replace the running test process on Unix).pkg/agent/updater/self_update_fallback_test.go(new): 3 unit tests forselfUpdateFallback:killBackendandrestartBackendare calledrestartBackenderrorexecReplaceFuncTest plan
go test ./pkg/agent/updater/... -run TestSelfUpdateFallbackpasses in CIFixes #20478
🤖 Generated with Claude Code