chore: delete dead functions and skip-only or duplicated tests - #29461
Draft
ibetitsmike wants to merge 3 commits into
Draft
ibetitsmike wants to merge 3 commits into
ibetitsmike wants to merge 3 commits into
Conversation
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.
Three mechanical clean-ups from the test-suite audit, one commit each:
coderd/exp_chats_test.gowhose whole body sat behind an unconditionalt.Skip("legacy chat provider API removed"), plusTestSuspendedPagination(its comment says it existed to check db-fake parity, and dbmem is gone) andTestWorkspaceFilter(its comment saysTestWorkspaceFilterManualcovers it). The other eight skip-only tests stay: their skip reasons (flakes tracked in issues, manual tests, a pending upstream refactor) still hold.TestServer/Logging/{CreatesFile,Human,JSON}started three server processes to assert that a log file appears (HumanduplicatedCreatesFile); they are now one server with a{flag, file}table.TestServer_Logging_NoParallel/{Stackdriver,Multiple}are one server with three sinks. The fouraibridge/providerTest*_TypeAndNametests are one table.golang.org/x/tools/cmd/deadcode -tags testsmallbatch ./cmd/... ./enterprise/cmd/...with and without-test; the intersection (dead even with every test as a root) is deleted, including the cascade (noopContainerCLI,NoopResolver,NoopResponseWriter,StatusQueue, five unuseddbgenhelpers, unused functional options, and so on). Left alone on purpose:scripts/rules.go(ruleguard DSL),vpn/(live on darwin/windows), thecoderd/debug.go_debug*swagger stubs,cli.SlimUnsupported(used under theslimbuild tag), and exportedcodersdk/agentsdk/workspacesdksymbols that need an external-consumer check first (ChatMessageSource,IsBedrockConfigured,IsChatGitWatchFallbackMessage,OAuth2RevocationTokenTypeHint.Valid,ParameterResolver.Resolve,ValidateNewWorkspaceParameters,ValidateWorkspaceBuildParameters,WithTrace,ServiceBannerFromProto,Stats.SessionCount,AgentReconnectingPTYInitWithContainer).Net: 46 files, +160 / -2285 lines (582 lines of production code, the rest tests).
Validation
go build ./...andgo vet -tags=testsmallbatch ./...(compiles every test; only two pre-existing copylocks findings in untouched files)golangci-lint runover all 31 touched packages with a fresh cache: 0 issuesgo test -race -count=2 -shuffle=onon the folded tests (./cli/ -run 'TestServer/Logging|TestServer_Logging_NoParallel',./aibridge/provider/): passPart of the test-suite speedup series (see #29457); independent of the other PRs.
Remote validation
Remote run on a dogfood workspace (separate compute), chat https://dogfood.cdr.dev/agents/5bbe73d0-866a-4841-9cc3-c5e5b4d97e44, tested head
3821cba7af8:go build ./...andgo vet -tags=testsmallbatch ./...(only the two pre-existing lock-copy findings in untouched files),clilogging tests andaibridge/providerpass,git grepconfirms only the intentionally keptcodersdksymbol remains; the runner independently verified on base that all eight deleted non-folded tests began witht.Skip. Endorsed verdict: PASS.