fix: resolve duplicate test declarations in server package#3098
Merged
Conversation
Rename redeclared newMinimalUnifiedServer and TestRequireSession in session_test.go to avoid vet errors caused by merge conflicts with unified_test.go and ensure_guard_initialized_test.go. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Resolves go vet/lint failures in the internal/server test package caused by duplicate top-level test/helper declarations introduced by recent merges, by renaming the conflicting symbols in session_test.go.
Changes:
- Renamed
newMinimalUnifiedServer(t)tonewMinimalUnifiedServerForSessionTest(t)insession_test.go. - Renamed
TestRequireSessiontoTestRequireSession_SessionManagementto avoid colliding with another test of the same name.
Comments suppressed due to low confidence (1)
internal/server/session_test.go:234
- The doc comment above this test still says
TestRequireSession, but the test function was renamed toTestRequireSession_SessionManagement. Please update the comment to avoid confusion and keep go doc output accurate.
// TestRequireSession verifies that requireSession auto-creates a new Session
// the first time a session ID is seen and reuses the same Session on subsequent calls.
func TestRequireSession_SessionManagement(t *testing.T) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+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.
Problem
make lintfails on main with:Two recently merged branches both added declarations that conflict:
session_test.go:newMinimalUnifiedServer(t)andTestRequireSessionensure_guard_initialized_test.go:newMinimalUnifiedServer(cfg)(different signature)unified_test.go:TestRequireSessionFix
Rename the
session_test.godeclarations to avoid conflicts:newMinimalUnifiedServer→newMinimalUnifiedServerForSessionTestTestRequireSession→TestRequireSession_SessionManagementAll tests pass with
make agent-finished.