Skip to main content

End-to-end tests

End-to-end tests use the FFI crate and an in-memory remote storage backend to check sync correctness.

Media integrity tests​

Media integrity tests use only media-creation operations. Every file is named with a UUID and contains that UUID's u128 encoded as 16 little-endian bytes. Every media read must return exactly those bytes.

Media integrity

Media preservation and retry

Setup: one device, one remote.

Confirms that one device can recover every imported media file from its only remote copy.

Description
  1. Import 16 media files.
  2. Push them to the remote.
  3. Evict every local copy.
  4. Fetch every file from the remote and verify its bytes.
Execution modes
No failure
Deterministic upload failure

Run three variants. In each variant, fail exactly media upload 1, 8, or 16 (fail PutAtomic). Complete the procedure by retrying the push without failure.

Upload succeeds, error reported

The first PutAtomic call writes successfully but reports an error. Complete the procedure by retrying the push without failure.

Deterministic download failure

Fail exactly the first Get call for a media/ key before it returns bytes. Retry that media read, then verify every file.

Media integrity

Media relay after eviction

Setup: one device, two remotes.

Confirms remote-to-remote media relay when the device has evicted its local copy.

Description
  1. Import 16 media files and push them to the first remote.
  2. Evict the local copies.
  3. Push to the second remote, using the first remote as the media source.
  4. Evict again, then fetch from the second remote and verify the bytes.
Execution modes
No failure
Random storage failures

Run 64 seeded variants. Each remote push has a 25% chance of one media-upload failure; half fail before the write takes effect, and half write successfully before reporting an error. When a sync procedure fails, retry that same procedure until it succeeds, with a limit of 100 attempts.

Media integrity

Shared-remote media convergence

Setup: three devices, one remote.

Confirms shared-remote convergence and byte-for-byte media availability across devices.

Description
  1. Give three devices the same library and remote.
  2. Import 16 distinct media files on each device.
  3. Push each device's media to the shared remote.
  4. Fetch remote operations, evict local media, and verify all 48 files on every device.
Execution modes
No failure
Random storage failures

Run 64 seeded variants. Each remote push has a 25% chance of one media-upload failure; half fail before the write takes effect, and half write successfully before reporting an error. When a sync procedure fails, retry that same procedure until it succeeds, with a limit of 100 attempts.

Media integrity

Fuzzy media convergence

Setup: three devices, three remotes.

A seeded fuzzy simulation exercises changing device state, media locality, and remote topology before a final independent verification.

Description
  1. Run 64 seeded tests with three devices sharing one library and three remotes.
  2. Run 64 rounds per seed, selecting a device and importing, pushing, relaying, evicting, or fetching media.
  3. Track every imported UUID and its expected bytes in the test model.
  4. Converge every remote, then verify every file from each remote independently on every device.
Execution modes
No failure

Compaction tests​

Compaction

Compaction integrity

Setup: one device, one remote.

Confirms that repeated compaction preserves the complete, unique operation history for the original and a fresh client.

Description
  1. Use metadata-only album-creation operations.
  2. Run 64 deterministic rounds, creating 1–30 operations and pushing them through FFI in each round.
  3. Allow repeated pushes to trigger remote compaction.
  4. Fetch the compacted remote with a fresh FFI client.
  5. Verify both clients contain every created operation and no duplicate dots.
Execution modes
No failure

Running the suite​

Run FFI end-to-end tests with:

cargo nextest run --release -p lasco-ffi