Skip to content

Rewrite Rust unit tests to use explicit SchemaColumn fixtures (drop infer_test_schema_columns) #240

Description

@0x054

Problem

#238 drops RegisteredModel.schema and the production JSON DDL path, but keeps infer_test_schema_columns and RegisteredModel::new_for_test as a pragmatic #[cfg(test)] bridge: JSON schema fixtures → minimal SchemaColumnModelCodecPlan::compile_from_columns.

That adapter is not production code, but it preserves a second JSON→IR inference path in the Rust test suite. Type-resolution behavior is already pinned on the lowering crate and cross-emitter parity tests; the adapter exists only for fixture ergonomics.

Proposed solution

  1. Replace RegisteredModel::new_for_test(json!({...})) call sites in Rust unit tests (query.rs, operations.rs, codec_plan.rs, state.rs, etc.) with explicit SchemaColumn fixtures (or a small shared test_fixtures module of named column sets).
  2. Delete infer_test_schema_columns, infer_test_logical_type, and the #[cfg(test)] JSON helpers they depend on (resolve_ref, property_json_type_and_format, json_schema_logical_type in schema.rs — only if no other test users remain).
  3. Optionally introduce RegisteredModel::new_for_test_from_columns(columns, table_name) as the canonical test constructor.

Acceptance criteria

  • No infer_test_schema_columns (or JSON→SchemaColumn inference) in the Rust codebase.
  • RegisteredModel::new_for_test either removed or rewritten to take Vec<SchemaColumn> only.
  • All existing Rust unit tests green (cargo test).
  • No regression in pytest codec/hydration matrix (fixtures change is Rust-only).

Context

Documentation impact

none — internal test infrastructure only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions