Repository navigation
feat(unit_timings): unit-test durations + import time live by CI ingestion - #207
Merged
Merged
Conversation
…stion (#206) lib-tests.yml — the reusable workflow every library's Tests gate calls — now emits a unit-timings-<py> artifact (pytest --junitxml per-test durations plus a fresh-process import time), and the daily heart-health run ingests it with a new unit_timings check: the N slowest tests and the suite wall-clock per leg, import seconds per package, run-to-run drift against the committed timings/ record (both-gates for tests; the import_time median-window doctrine for imports), recorded as timings/unit/<repo>.jsonl. The existing Unit-test timing and Import timing board sections come alive from the same summaries the dev-box checks write, and workspace_testmode_timing is retired from the board as superseded by the per-script smoke timings. Readiness verdict and badge untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
This was referenced Sep 5, 2026
Closed
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.
Closes #206. Phase 3 of the
ci-timing-fast-testsepic (PyAutoMinddraft/feature/pyautoheart/ci_timing_fast_tests_epic.md).Summary
Three checks were documented as "run on a daily cron" and no cron existed:
unit_test_timing(never run),import_time(ran once),workspace_testmode_timing(never run). Their board rows have rendered "not observed here" every day. The execution home is ingestion, not a new cloud leg: every library'sTestsgate is a thin caller of this repo's reusablelib-tests.yml, which already installs the source stack and runs pytest on every push and PR.lib-tests.yml(unittestmatrix job only) — acontinue-on-errorstep times a fresh-processimport <package>(the cold cost the developer loop pays;seconds: nullon failure, never a fabricated 0), pytest gains--junitxml(built-in, every test, no console scraping), and both are uploaded asunit-timings-<py>withif: always()/if-no-files-found: ignoreand no retention cap. This workflow is referenced@mainby six libraries, so every new step is non-fatal and the pytest exit path is untouched apart from the one flag. Theunittest-nojaxjob is unchanged.heart/checks/unit_timings.{sh,py}— the sixth cloud-safe check inheart-health.yml, in thesmoke_timingsshape (the artifact selector is shared, parametrised by name pattern). Per library repo and python leg: the suite wall-clock and counts, the N slowest tests (top_n: 25from config), the import seconds. Test drift is the both-gates rule (≥2.0× AND ≥2 s vs the previous recorded run of the same test, run id must differ); import drift is the existingimport_timedoctrine (ratio to the median of the last 7 recorded runs,buildinguntil 3 samples, 1.5×/3.0× yellow/red). Rows carry/hygiene perfprompts.unit_test_timing.jsonandimport_time.jsonin exactly the shapes the dev-box checks produce (python: "ci"), so "Unit-test timing" and "Import timing" render unchanged and gain per-leg detail lines (suite wall-clock + slowest test; import seconds).import_time,unit_test_timingandworkspace_testmode_timingleaveLOCAL_ONLY_FAMILIES: the first two are now cloud-observed, the third is retired from the board as superseded by the Smoke scripts row (feat(smoke_timings): ingest per-script smoke timings onto the ⏱ board #203) — the smoke gates already run those scripts inTEST_MODE=2on every PR. All three modules stay runnable on demand; their docstrings now say so.timings/unit/<repo>.jsonl(one line per python leg × run id: suite totals, the slowest tests, import seconds), same append-only and run-id dedupe rules;heart.timings append --unit-timings; README updated.performance.unitis an additiveboard.jsonkey emitted only when observed.API Changes
No public API change. New module
heart.checks.unit_timings;smoke_timings.select_artifactsgains an optionalpatternkeyword (default unchanged);heart.timingsgains theunit/writer and readers; new snapshot keyunit_timings;config/repos.yaml thresholds.unit_timings;LOCAL_ONLY_FAMILIESloses three families.Test Plan
python3 -m pytest -q -n auto— 767 → 841 passed (48 intests/test_unit_timings.py, 5 intests/test_lib_tests_wiring.py, 2 shell tests with stubgh/unzip, the rest appended to existing files). One existing census assertion widened for the two new census keys (named feat: bring unit_test_timing + import_time live by ingesting lib-tests.yml artifacts #206 in a comment); nothing else modified.bash -nthe new shell leg;yaml.safe_loadon both workflows and the config; tenant firewall check OK (fake names only in new files)unit-timings-3.12/-3.13artifacts appear on aTestsrun withjunit.xml+import_time.json, and the gate's conclusion is unaffectedheart-health.ymlrun: "Unit-test timing" and "Import timing" rows render with per-leg lines (import rowsbuildinguntil 3 runs are recorded);timings/unit/appears in the daily commit. The cross-repo artifact 403 caveat from feat(smoke_timings): ingest per-script smoke timings onto the ⏱ board #203 applies to the library repos too — sameHEART_TIMINGS_TOKENremedy.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
Generated by Claude Code