You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/data/oold/remote_context/ is named for a remote @context but exercises a cross-directory one. Counting every string @context and $ref in the corpus at b4e23ac:
Kind
Count
same-directory sibling
25
cross-directory (..)
6
true HTTP (http://, https://)
0
The 6 cross-directory references are remote_context/Leaf.schema.json, broken/root_ref_not_reflected.schema.json, and four in broken/context_array_order_mismatch.schema.json.
So no fixture ever makes Resolver fetch a schema or a context over HTTP. That path is reached only by --meta remote, which fetches the meta-schemas rather than a document's @context, and by the opt-in parity tests.
Why it matters
context.remote is a FAIL-level check whose whole subject is a schema working as a remote context, and nothing in the corpus makes it remote.
Resolver's fetch, disk cache and offline=True refusal are exactly the layer Use referencing for resolve.py's URI and retrieval layer #119 proposes moving onto referencing. That refactor currently has no fixture touching retrieval, so a regression would pass CI.
The name misleads. A reader of remote_context/Leaf.schema.json reasonably concludes the remote path is covered.
The constraint that makes this a separate piece of work
A fixture that reaches the real network is not deterministic and cannot run in the offline CI matrix. Three shapes, cheapest last:
Local HTTP server. A pytest fixture serving tests/data/oold/remote_context/ from http://127.0.0.1:<port>/, with the schema's @context pointed at that base when the fixture is built. Real socket, real Resolver retrieval path, no external dependency. The committed fixture cannot carry the URL, since the port varies, so the schema has to be templated or rewritten into tmp_path.
Stub transport. Monkeypatch Resolver's retrieval hook to serve from disk under an https:// URL. Deterministic and small, but it skips the code under test, which is the retrieval itself.
Warm cache. Commit a cache entry keyed by an https:// URL and run with offline=True, asserting the cached document resolves and that a missing one is refused with the offline message. Tests the cache and the refusal, not the fetch.
1 and 3 are complementary rather than alternatives: 3 covers the offline guarantee the vendored meta-schemas depend on, 1 covers the fetch. 2 is worth having only if 1 turns out to be flaky in CI.
Also
Either rename remote_context/ to say cross-directory, or give it a genuinely remote sibling so the name is true. Renaming touches tests/test_validation/conftest.py's fixture and docs/maintaining-meta-schemas.md.
tests/data/oold/remote_context/is named for a remote@contextbut exercises a cross-directory one. Counting every string@contextand$refin the corpus atb4e23ac:..)http://,https://)The 6 cross-directory references are
remote_context/Leaf.schema.json,broken/root_ref_not_reflected.schema.json, and four inbroken/context_array_order_mismatch.schema.json.So no fixture ever makes
Resolverfetch a schema or a context over HTTP. That path is reached only by--meta remote, which fetches the meta-schemas rather than a document's@context, and by the opt-in parity tests.Why it matters
context.remoteis a FAIL-level check whose whole subject is a schema working as a remote context, and nothing in the corpus makes it remote.Resolver's fetch, disk cache andoffline=Truerefusal are exactly the layer Use referencing for resolve.py's URI and retrieval layer #119 proposes moving ontoreferencing. That refactor currently has no fixture touching retrieval, so a regression would pass CI.remote_context/Leaf.schema.jsonreasonably concludes the remote path is covered.The constraint that makes this a separate piece of work
A fixture that reaches the real network is not deterministic and cannot run in the offline CI matrix. Three shapes, cheapest last:
tests/data/oold/remote_context/fromhttp://127.0.0.1:<port>/, with the schema's@contextpointed at that base when the fixture is built. Real socket, realResolverretrieval path, no external dependency. The committed fixture cannot carry the URL, since the port varies, so the schema has to be templated or rewritten intotmp_path.Resolver's retrieval hook to serve from disk under anhttps://URL. Deterministic and small, but it skips the code under test, which is the retrieval itself.https://URL and run withoffline=True, asserting the cached document resolves and that a missing one is refused with the offline message. Tests the cache and the refusal, not the fetch.1 and 3 are complementary rather than alternatives: 3 covers the offline guarantee the vendored meta-schemas depend on, 1 covers the fetch. 2 is worth having only if 1 turns out to be flaky in CI.
Also
Either rename
remote_context/to say cross-directory, or give it a genuinely remote sibling so the name is true. Renaming touchestests/test_validation/conftest.py's fixture anddocs/maintaining-meta-schemas.md.Raised in review of #114 (#114 (comment)).