tests: raise cosift coverage from 50% to 56%#1
Merged
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
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
*_test.gofiles (2,296 lines) targeting the lowest-coverage packages.Per-package coverage delta
internal/configinternal/evalinternal/storeinternal/embedinternal/crawlercmd/cosiftinternal/indexinternal/rerankinternal/serverWhat's covered
Default,Load(missing file / malformed JSON / file present / empty data-dir fallback),applyEnvOverrides(PORT / COSIFT_LISTEN / COSIFT_DATA_DIR / whitespace ignored),LoadDotEnv(missing file / quoting / comments / no-override-existing).LoadQuerySet,LoadCorpus,LoadSummary,SaveSummary(incl. write-error),Run(with and without paraphrases, retriever errors, paraphrase tolerance),rrfFuse,score,PrintTable,Diff.Stats,GetDocTexts(incl. maxLen),ListDocSitemapEntries,CountByDomain,CountPassagesAllModels,CountParaphrases,CountHyDE,CountDocsWithPublishedAt,ListOutcomes,Vacuum,CountQueuedPerHost,RecrawlURL(both branches).Metrics,Checkpoint,PutVectorMeta/GetVectorMeta,PutVectorNode/IterateVectorNodes,PutVectorNodesBatch,ClearVectorFamily,PutPQCodebook/GetPQCodebook/PutPQCodesBatch/IteratePQCodes,ClearPQFamily,UpsertDocumentBatch(incl. empty-URL rejection + re-upsert ID stability),IterDocsLite,PurgeFrontierByHost,CorpusStats,SumDocLengths,ListDomains(filter + pagination + defaults),TopDomains,TopQueuedHosts,GetDocMeta.OpenAIClient.Model/Dim,NewOpenAIChatURL normalization,RoundRobinEmbedder(empty/single/distributing),ThrottledEmbedder(max<=0 unwraps, concurrency-cap actually enforced, ctx-cancel during queue),BatchingEmbedder(defaults, single-call, empty, coalescing, inner-error propagation),CachedEmbedderhit/miss accounting on disk and in-memory.parseProxies(empty, malformed, no-host skipping),Robots.Allowedagainst anhttptest.NewServer(disallow / allow-overrides-disallow / crawl-delay / bad URL),Robots.Sitemaps, robots cache (one fetch across many calls), 404-treated-as-empty,parseRobotscorner cases.authStatus,resolveAPIKey(slot precedence + OPENAI / OPENAI_API_KEY fallback),resolveEmbedAPIKey,firstEnv,contains,chunkerWith,sqrt,randUnit(magnitude + determinism),percentiles,sumDur,newSeededRand,benchResult.formatHuman(all modes + unknown fallback),sortedModes,union,neutralVocabForDistractors,generateDistractorText.Notes / observations
cmd/cosiftis 12.6k lines (38% of the codebase) and most uncovered code paths are top-level command handlers that wire a livecrawler.Crawler,store.Store, and HTTP server together and depend on an OpenAI-shaped backend. Reaching them needs either OpenAI access or extensive HTTP-fake scaffolding beyond the scope of this PR.store.OpenMemoryrecordspath = ":memory:"but the migration path checks columnExists via raw SQL — works fine, just notable that the in-memory store inherits the full migration code path.httptest.NewServer..envfile (gitignored) was not read, modified, or referenced.Test plan
go test -race -count=1 -timeout 120s ./...passes locally (verified)