Skip to content

Tests that cannot fail: self-comparisons, unchecked branches and a fix's test never seen failing (2026-11 sweep) #2717

Open

Description

@Mavrick-F

The 2026-11 release quality pass found 24 points, out of 297, where a test can't fail, or can't fail for the reason it exists. Most are fixed or tracked already. This issue is about catching the same shape before merge, plus the few cases on main that no issue tracks yet.

What the sweep found

In each case the test arrived in the same pull request as the change it covers, and nothing shows it was ever seen failing.

Not tracked yet

  • crates/data/src/source/gdal.rs ~787 checks that the cache key's hash is stable with assert_eq!(fnv1a(b"rustgis"), fnv1a(b"rustgis")), which holds whatever fnv1a returns. crates/data/src/time.rs ~543 compares add(f64::MAX, …) with itself, so it checks only that the call doesn't panic.
  • crates/data/src/dxf.rs (reads_entities_blocks_and_hatches, layers_filter_and_crs, polylines_and_polyfaces): four geometry checks sit inside if let Some(Geometry::…) with no else, so a feature read with no geometry, or with the wrong kind, passes. Most other readers' tests use else { panic!(…) }.
  • Five property tests (analysis/tests/parallel_serial.rs, data/tests/integration/{extent_query_properties,date_properties,reprojection_round_trip}.rs, geom/tests/geodesic_identities.rs) copy the same env() helper, so an unparsable PROPERTY_SEED or PROPERTY_CASES runs the defaults without a word. The copies in never_silent_roundtrip and project_save_roundtrip now panic on a value that isn't a whole number (fix(engine): say cut names, unknown project keys and held parameters (#2639, part 1) #2658).
  • The DuckDB tests in crates/data/src/source/duckdb.rs, crates/engine/src/tests.rs and crates/engine/tests/integration/portable_projects/reload.rs return early without DuckDB in the same way as the GDAL ones, and no workflow installs DuckDB either. The switch Developer tooling: GDAL tests in CI, xtask rows rebuilds, CI platform conditions (2026-11 sweep) #2644 proposes could cover both.

Proposal

  1. Say how the new test was seen failing. For a fix, the pull request's Testing section says that the new or changed test fails without the fix and quotes the failure. For a new check or oracle, it names a change that breaks what it checks and says the test then fails. fix(tiles): harden redirects, picture probes and Earthdata sign-out #1570 did this ("hand mutants … the test failed with the mutant in place"). Add one line to the template's Testing comment and to docs/contributing.md. This costs one local test run per fix and nothing in CI.
  2. cargo xtask test-hygiene refuses an assertion that compares an expression with itself (assert_eq!(a, a), assert_ne!(a, a), same tokens on both sides). It is a spelling check on the tokenizer it already has, with no exceptions to mark. A search of main for this shape finds the two cases above (the third, in kriging_files_huge_coordinates_in_cells_of_their_own, is fixed in chore(sweep): render, map and analysis fixes from the release quality pass #2652).
  3. Fix the cases listed under "Not tracked yet": a fixed expected value for fnv1a; else { panic!(…) } in the DXF tests; the same panic on a value that doesn't parse in the five env() copies.

Out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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