Skip to content

test: crud/conditional_tests.rs never calls a conditional operation #867

Description

@aacruzgon

Summary

crates/persistence/tests/crud/conditional_tests.rs compiles and runs (18 tests) but never calls a conditional operation, so it reads as coverage for ConditionalStorage and is not.

Evidence

  • Compiled via crates/persistence/tests/crud_suite.rs:14 (mod crud;) and tests/crud/mod.rs:6 (pub mod conditional_tests;), under the default sqlite feature, so cargo test -p helios-persistence executes all 18.
  • The only storage trait imported is use helios_persistence::core::ResourceStorage; (:9); ConditionalStorage is never in scope. Every backend call is create/read/update/delete/exists/count.
  • The banner at :49-52 says the tests "serve as a specification for expected behavior when implemented"; e.g. :74 "For now, we test basic create since conditional_create needs SearchProvider". SearchProvider and ConditionalStorage have been implemented on SQLite for some time.
  • The four test_conditional_patch_* tests (:444-634) hand-mutate JSON and call backend.update; test_if_match_success/_failure (:310, :333) assert update version semantics, not If-Match plumbing.

Real coverage lives in tests/sqlite_tests.rs (test_conditional_*), postgres_tests.rs, mongodb_tests.rs, and tests/transactions/bundle_tests.rs.

Proposed fix

Either rewrite the file against ConditionalStorage (create/exists/multiple, update/upsert, delete/no-match, patch in all three formats, tenant isolation) or delete it and move anything unique into sqlite_tests.rs.

Found while validating #511 (see PR #860).

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions