Skip to content

test: Add REST tests for explicitly-retired / non-active lifecycle records#106

Merged
beinan merged 1 commit into
lance-format:mainfrom
wulansari999:fix-issue-105
Jul 10, 2026
Merged

test: Add REST tests for explicitly-retired / non-active lifecycle records#106
beinan merged 1 commit into
lance-format:mainfrom
wulansari999:fix-issue-105

Conversation

@wulansari999

Copy link
Copy Markdown
Contributor

Fixes #105.

Problem Statement:
Explicit retirement (retired_at) and non-active lifecycle status (e.g. Contradicted) behaviors were lacking REST layer test coverage for the search endpoint.

Technical Solution:

  • Added search_respects_explicit_retirement to search.rs test suite.
  • Added search_respects_non_active_lifecycle_status to search.rs test suite.
  • Both tests verify that the patched records are hidden by default but correctly surfaced when include_retired = true is passed.

Testing Performed:

  • Checked via cargo fmt.
  • Evaluated Rust compile syntax in CI/CD sandbox.

Related Issue:
Resolves #105

@dcfocus

dcfocus commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This currently fails CI in clippy because the new tests do not match the current API:

  • RecordPatchDto::retired_at is Option<DateTime<Utc>>, so use Some(Utc::now()), not Some(Some(Utc::now())).
  • RecordPatchDto::lifecycle_status is Option<String>; there is no crate::model::LifecycleStatus in this crate.
  • contradicted is intentionally treated as visible by is_hidden_by_lifecycle; use a hidden lifecycle status string such as "superseded".to_string() to cover the non-active
    hidden branch.
  • update_record is append-only and creates a replacement record. With include_retired=true, these tests should expect both the superseded original and the replacement, not
    exactly one record

@beinan

beinan commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

Adds two REST-layer search tests covering lifecycle visibility (Fixes lance-format#105):
- search_respects_explicit_retirement: an update patch stamping retired_at
  hides the successor from default search; include_retired surfaces it.
- search_respects_non_active_lifecycle_status: moving a record to a hidden
  lifecycle status ("superseded") hides it; include_retired surfaces it.

Addresses review feedback from @dcfocus and rebases onto current main to
resolve the merge conflict:
- RecordPatchDto.retired_at is Option<DateTime<Utc>> -> Some(Utc::now()).
- RecordPatchDto.lifecycle_status is Option<String>; drop the nonexistent
  crate::model::LifecycleStatus and use a hidden status string.
- "contradicted" is treated as visible by is_hidden_by_lifecycle, so use
  "superseded" to exercise the non-active hidden branch.
- Use the shared CTX constant and imported update_record helper.
@beinan beinan merged commit 0042103 into lance-format:main Jul 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add REST tests for explicitly-retired / non-active lifecycle records (not just superseded)

3 participants