[test-improver] Improve tests for launcher package#10089
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[test-improver] Improve tests for launcher package#10089github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…ctStdioCommand - Add TestGetOrLaunchForSession_ServerNotFound to cover ErrServerNotFound path - Add TestGetOrLaunchForSession_HTTPBackendRecordsStart to cover HTTP backend recordStart path and verify server state tracking - Add TestGetOrLaunchForSession_DoubleCheckLockPoolHit to exercise pool cache hit - Add nil config case to TestIsDirectStdioCommand table - Add TestNew_RunningInContainer to cover container detection log branch in New() Coverage: internal/launcher 96.8% → 97.3% Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Improved test coverage for
internal/launcherpackage from 96.8% → 97.3%.File Analyzed
internal/launcher/getorlaunchforsession_test.goandinternal/launcher/launcher_runtime_test.goImprovements Made
New tests in
getorlaunchforsession_test.goTestGetOrLaunchForSession_ServerNotFound— covers theErrServerNotFounderror path when an unknown server ID is requestedTestGetOrLaunchForSession_HTTPBackendRecordsStart— covers the HTTP backend path throughGetOrLaunchForSession→getOrLaunchWithConfig→recordStart, and verifies server state is marked as "running"TestGetOrLaunchForSession_DoubleCheckLockPoolHit— exercises the session pool cache hit path where a pre-populated pool entry is returned without launching a new backendUpdated tests in
launcher_runtime_test.gonil configcase added toTestIsDirectStdioCommandtable — covers theif serverCfg == nil { return true }guard inisDirectStdioCommandTestNew_RunningInContainer— covers thelog.Println("[LAUNCHER] Detected running inside a container")branch inNew()by settingRUNNING_IN_CONTAINER=trueCoverage Before/After
launcher.go: Newlauncher.go: isDirectStdioCommandTest Output
All tests pass with
-count=3for stability verification.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
index.crates.ioSee Network Configuration for more information.