Skip to content

[Tests] Weak or missing assertions allow latent bugs to pass CI #45

Description

@s2x

Context / Problem

Several tests assert too weakly to catch real defects:

tests/Integration/BasicCrudTest.php:153 — getAddressesForKey only asserts assertNotEmpty($addresses). An array of FFI\CData objects is still "not empty", so it masks the wrong-return-type bug in FutureStringArray.
tests/Integration/DirectoryTest.php:363-374 — the partition subdirectory test never writes/reads a key through the returned subspace, so the partition prefix layout is never validated.

Affected files / locations

  • tests/Integration/BasicCrudTest.php:145-154
  • tests/Integration/DirectoryTest.php:362-374

Proposed approach

Strengthen assertions to verify behavior, not just shape: assert assertContainsOnly('string', ...) for addresses; in partition tests, set a value via the returned subspace and assert the exact byte prefix of the stored key. Audit the rest of the suite for assertions that do not exercise the claimed behavior.

Acceptance Criteria

  • Documentation updated/added (testing conventions note)
  • Unit test(s) added/strengthened where applicable
  • Functional test(s) added: address-type assertion and partition key-prefix round-trip
  • Changelog entry added
  • Post-implementation comment posted on this issue describing what was changed

Severity

Medium

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