From f113fc1cda5af3ab333addf7dab758fdd56a46a6 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 21 Jun 2026 03:19:08 -0400 Subject: chore(todo): file migrate-off-primitive-mocking test task --- todo.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/todo.org b/todo.org index 4d988981c..3f9b820a1 100644 --- a/todo.org +++ b/todo.org @@ -3641,6 +3641,18 @@ Dropped erc-yank 2026-06-20 (Craig's call: drop, not harden). The package turned :END: =modules/coverage-core.el:252= — =cj/--coverage-intersect= joins covered×changed by exact string key, but simplecov.json keys are ABSOLUTE paths while the git-diff parser returns repo-RELATIVE ones — zero matches ever, so working-tree/staged/branch scopes report ":tracked nil" for everything and F7's main feature is inert (whole-project scope works, same-source keys). Unit tests hand-build matching keys so they pass; add one integration test feeding a real undercover report + real diff. Normalize both sides to repo-relative. From the 2026-06 config audit. +** TODO [#C] Migrate tests off mocking primitives (native-comp robustness) :test:refactor: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-21 +:END: +Long-term test-quality work surfaced by re-enabling native-comp (2026-06-20). When a test redefines a C primitive or a native-compiled function (=cl-letf=/=fset=/=advice-add=), native-comp routes native callers through a trampoline, which interacts badly with mocks in three ways: trampoline-build failure under =--batch=, silent mock-bypass (native callers ignore the redefinition), and arity mismatch (the trampoline calls the mock with the primitive's max arity). + +Done 2026-06-21 (the immediate fix): swept every arity-narrow subr mock to =(lambda (&rest _) ...)= (188 sites) and added =tests/test-meta-subr-mock-arity.el=, which fails =make test= on any arity-narrow subr mock. That kills the arity mode (the only one we've hit) and enforces it going forward. + +This task is the durable fix the ecosystem and =elisp-testing.md= point to: restructure tests so they don't redefine primitives at all — inject dependencies, drive real state (temp-file fixtures, real buffers), or test pure helpers. That closes the two latent modes (build-failure, silent-bypass) the variadic sweep leaves open. Big, incremental, low-urgency. + +Full mechanism, the three failure modes, the research (Emacs bug#51140, bug#61880, buttercup #230, Debian #1021842, the emacs-29 redefine-primitive warning, the manual on =native-comp-enable-subr-trampolines=), and the decision: [[file:docs/native-comp-subr-mocking.org][docs/native-comp-subr-mocking.org]]. + ** TODO [#B] Fix up test runner :bug: :PROPERTIES: :LAST_REVIEWED: 2026-06-06 -- cgit v1.2.3