Repository navigation
test: add bounded generated pagination and input-validation properties - #282
Conversation
#280 remains partial: structural-input domain errors need separate runtime authorizationThe issue body explicitly requests controlled errors for malformed YAML, missing fields and wrong metadata types. The tests-only scope cannot truthfully complete those points by accepting raw implementation exceptions or silently xfail/skip them. This PR therefore does not close #280. Source-inspected minimal cases (not executed as passing CI acceptance): from pt_snap_cli.query.config import QueryConfig
QueryConfig.load_yaml_from_string("queries: []") # unchecked .items(): AttributeError
QueryConfig.load_yaml_from_string("- item") # unchecked .get(): AttributeErrorBoth file/string loaders in For the snapshot boundary, start with trusted in-memory data, not an untrusted pickle: missing_action = {"addr": 4096, "size": 1, "stream": 0, "frames": []}
wrong_type = {"action": "alloc", "addr": 4096, "size": None, "stream": 0, "frames": []}
representation = {"segments": [], "device_traces": [[missing_action]]}
# Repeat with wrong_type. Replace only the current snapshot2db
# load_snapshot_representation seam to return representation, then call
# SnapshotImportBackend().dump_to_db(source, output, device=0).Source conversion directly indexes The mergeable property-test portion retains deterministic real SQLite pagination, YAML schema/registry behavior, metadata contracts and existing numeric- |
|
Integration sequencing note: this branch will include the unchanged, independently reviewed PR281 test changes so CI can validate the intended combined tree before serial merging. This is a temporary integration-stack ordering, not a functional dependency of the property tests. PR281 must be accepted first; the final main/head comparison, all required checks and branch protection still apply. No code/test assertions or runtime scope is weakened, and issue280 remains partial. |
|
Updated to The runtime gaps documented in the original description are now addressed by separately authorized PR #286, not folded into this tests-only delta. The issue's compatibility boundary has been clarified in #280: retain valid defaults and existing loader compatibility, reject illegal shapes/types/missing required fields, and retain rejection of unknown runtime arguments/output-schema fields. #280 remains open until the combined acceptance matrix and post-merge validation succeed. |
|
Final actual-main head |
|
Post-merge validation is now complete and successful at main |
Scope
Partial test-system implementation for #280. No runtime/product changes, executable fixture additions, parser-v3 decisions, live-provider calls or acceptance weakening. Adds Hypothesis only to the dev extra.
Each property has bounded examples, deterministic generation for a fixed Hypothesis version, shrinking/reproduction blobs and no machine-speed deadline. No assume/filter escape, broad-exception pass, xfail or health-check suppression.
Known remaining #280 gap — not closed by this PR
Static source inspection (not a claimed executed reproducer) shows the stronger arbitrary-malformed-input invariant is not currently true:
QueryConfig.load_yaml_from_string("queries: []")/"- item"reach unchecked.items()/.get()insrc/pt_snap_cli/query/config.py:439-444; the direct loader can leakAttributeError. The registry's documented warning-and-skip boundary is a different contract.action/size=Nonein trusted in-memory snapshot events lead toKeyError/TypeErrorinsnapshot/base/entities.py:89-91;SnapshotImportBackendcurrently normalizes ValueError but not these types.Runtime hardening is outside the user's tests-only authorization. These cases are not silently xfailed or redefined as correct behavior. Refs #280. This is a partial delivery; the tracking issue must remain open until the separate runtime follow-up and its complete acceptance are finished. This PR does not claim all malformed YAML/pickle structures are controlled.
Verification
Independent source/diff review completed before publication. Scoped Ruff/Black, AST, TOML and diff checks passed. Normal tests/build were not duplicated locally. Exact head
9da523d0417b198c4ee6a21dfa2a40faa526f3f0passed all 12 applicable checks: Linux Python 3.10–3.13 (full coverage and installed-wheel acceptance included), lint, provenance, real Chromium, four Windows shards and macOS. Evidence: Test run 41283575652 and Platform run 41283575650. Nightly/manual dataset acceptance was skipped by event policy and is not claimed as executed.