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 preservation and retry
Setup: one device, one remote.
Confirms that one device can recover every imported media file from its only remote copy.
- Import 16 media files.
- Push them to the remote.
- Evict every local copy.
- Fetch every file from the remote and verify its bytes.
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.
The first PutAtomic call writes successfully but reports an error. Complete the procedure by retrying the push without failure.
Fail exactly the first Get call for a media/ key before it returns bytes. Retry that media read, then verify every file.
Media relay after eviction
Setup: one device, two remotes.
Confirms remote-to-remote media relay when the device has evicted its local copy.
- Import 16 media files and push them to the first remote.
- Evict the local copies.
- Push to the second remote, using the first remote as the media source.
- Evict again, then fetch from the second remote and verify the bytes.
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.
Shared-remote media convergence
Setup: three devices, one remote.
Confirms shared-remote convergence and byte-for-byte media availability across devices.
- Give three devices the same library and remote.
- Import 16 distinct media files on each device.
- Push each device's media to the shared remote.
- Fetch remote operations, evict local media, and verify all 48 files on every device.
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.
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.
- Run 64 seeded tests with three devices sharing one library and three remotes.
- Run 64 rounds per seed, selecting a device and importing, pushing, relaying, evicting, or fetching media.
- Track every imported UUID and its expected bytes in the test model.
- Converge every remote, then verify every file from each remote independently on every device.
Compaction tests
Compaction integrity
Setup: one device, one remote.
Confirms that repeated compaction preserves the complete, unique operation history for the original and a fresh client.
- Use metadata-only album-creation operations.
- Run 64 deterministic rounds, creating 1–30 operations and pushing them through FFI in each round.
- Allow repeated pushes to trigger remote compaction.
- Fetch the compacted remote with a fresh FFI client.
- Verify both clients contain every created operation and no duplicate dots.
Running the suite
Run FFI end-to-end tests with:
cargo nextest run --release -p lasco-ffi