test: cover JSONFormatter and macro retrieval metrics (Tier A)#329
Open
voorhs wants to merge 1 commit into
Open
test: cover JSONFormatter and macro retrieval metrics (Tier A)#329voorhs wants to merge 1 commit into
voorhs wants to merge 1 commit into
Conversation
Add unit tests for two previously-untested pure-logic units:
- autointent._logging.formatter.JSONFormatter (was 0%): message/timestamp
rendering, fmt_keys remapping, exc_info, stack_info, and extra record fields.
- autointent.metrics.retrieval macro variants + the _macrofy helper:
retrieval_{map,hit_rate,precision,ndcg,mrr}_macro. Ground-truth constants are
the deterministic metric outputs, matching the existing retrieval-metric tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What
First of a short series of independent coverage PRs against
dev(follow-up to #325). Tier A — pure-logic, deterministic tests, no new runtime deps.Adds tests for two units that the suite never exercised:
autointent._logging.formatter.JSONFormatter(was 0%): record→JSON rendering,fmt_keysremapping (incl. consuming always-fields),exc_info,stack_info, and extra record attributes.autointent.metrics.retrievalmacro variants + the shared_macrofyhelper:retrieval_{map,hit_rate,precision,ndcg,mrr}_macro(previously the only untested retrieval metrics). Ground-truth constants are the deterministic metric outputs, matching the convention of the existingtest_retrieval_metrics*.py.Notes
unit-testsCI job (not undermodules/scoring,pipeline, orembedder).ruff checkandmypy --strict(Python 3.10, matching CI). Test execution is left to CI.🤖 Generated with Claude Code