test: unify testing strategy, CI parity, high-value coverage + gl-deprecation hardening#3779
Open
DennisSmolek wants to merge 1 commit into
Open
test: unify testing strategy, CI parity, high-value coverage + gl-deprecation hardening#3779DennisSmolek wants to merge 1 commit into
DennisSmolek wants to merge 1 commit into
Conversation
…rden gl deprecation Canonical testing guide (docs/development/TESTING.md): three-tier model (unit+mock / browser-GPU / headless spike), local<->CI parity rules, test organization conventions, coverage policy, and an open roadmap. CI / local parity: - Run verify-bundles + verify-types in test.yml (matching the pnpm ci order) - text-summary coverage reporter + upload coverage/ artifact High-value tests (~120 new; lines coverage ~78%): - scheduler integration: render-phase takeover + fps end-to-end (drop true/false), as integration with the external @pmndrs/scheduler package - Canvas size control / textureColorSpace / gl deprecation warning path - canvasRegistry / renderer config-bag parser / ScopedStore Proxy semantics - events: interactivePriority, XR register/unregister, frame-timed edges (+ resolved a pre-existing it.todo) - WebGPU hook lifecycle via the WebGPUContext mock (useUniforms/useNodes/ useBuffers/useGPUStorage/useRenderPipeline) + useRenderTarget; GPU-only paths left as it.todo (Tier 2) - v10 state.clock removal contract Refactor (testability, behavior-preserving): - Extract the Canvas renderer config-bag parser into utils/parseRendererConfig.ts Fix: - Harden the state.gl deprecation heuristic: extract utils/isInternalRendererAccess.ts that inspects only the immediate caller frame with path-independent markers, replacing a brittle hard-coded repo-path substring that mis-fired in installed packages and non-canonically-named checkouts. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Unifies and standardizes how R3F is tested, closes the biggest coverage gaps on the new v10 surfaces, and hardens one deprecation bug found along the way. Builds on the recent alpha.3 work (scheduler extraction,
useTextures, the multi-canvas/HMR/background fixes).What's here
Canonical testing guide —
docs/development/TESTING.mdrewritten as the single source of truth: a three-tier model (Tier 1 unit+mock in CI, Tier 2 browser/GPU pre-release gate, Tier 3 headless spike), local↔CI parity rules, test-organization conventions, coverage policy, and an open roadmap.CI / local parity
verify-bundles+verify-typesnow run intest.yml(they were local-only viapnpm ci— CI could drift)text-summarycoverage reporter +coverage/uploaded as a build artifactHigh-value tests (~120 new; overall lines coverage ~78%)
drop: true/false), as integration with the external@pmndrs/scheduler(not its internals)textureColorSpace/gldeprecation warning pathcanvasRegistry,rendererconfig-bag parser,ScopedStoreProxy semanticsinteractivePriority, XR register/unregister, frame-timed edges (+ resolved a pre-existingit.todo)WebGPUContextmock (useUniforms/useNodes/useBuffers/useGPUStorage/useRenderPipeline, now 62–90%) +useRenderTarget. GPU-only paths are left asit.todotagged for Tier 2.state.clockremoval contract (v10 regression guard)Refactor (behavior-preserving, for testability)
rendererconfig-bag parser intoutils/parseRendererConfig.ts(mirrorsparseBackground.ts; not re-exported)Fix
state.gldeprecation heuristic (utils/isInternalRendererAccess.ts): inspect only the immediate caller frame with path-independent markers, replacing a brittle hard-coded repo-path substring that mis-fired for installed packages and any non-react-three-fiber-named checkout (R3F's own<Environment>read spuriously warned; in the canonical repo it suppressed all access).Notes for reviewers
NoColorSpaceis unselectable via the config bag ('' || SRGBColorSpace), and thestate.glgetter only lives on the initial store object.it.todos are all genuinely GPU-dependent (Tier 2), not skipped work.Test plan
pnpm test→ 43 files, 532 passed / 6 todo / 0 failedpnpm typecheck,pnpm eslint,pnpm formatall passpnpm build && pnpm verify-bundles && pnpm verify-typespassNot included / follow-ups
pnpm test:gpu) — strategy documented, harness not built🤖 Generated with Claude Code