upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/sync.rs
AgeCommit message (Collapse)Author
2026-01-09feat(sync): invalidation + immediate re-processing of maintainer announcementsDanConwayDev
- Add two-tier rejected events index (hot cache + cold index) - Hot cache: 2-minute in-memory storage of full rejected events - Cold index: 7-day metadata storage for deduplication - Immediate re-processing when owner announcements list maintainers - Fix rejection reason detection to match actual error messages - Rewrite integration tests to use two-relay sync pattern - All tests passing (3 passed, 1 ignored slow test)
2025-12-19test: clear names for sync testsDanConwayDev
2025-12-18refactor: migrate historic_sync.rs tests to use run_sync_test() helperDanConwayDev
- Refactored all 4 tests in historic_sync.rs to use run_sync_test() - Tests maintain same logic and assertions, only setup simplified - Moved run_sync_test() and SyncTestResult outside #[cfg(test)] module - Updated validation to allow empty event slices (for announcement-only tests) - All 4 historic_sync tests passing (test_bootstrap_syncs_existing_layer2_events, test_relay_replays_events_after_restart, test_announcement_not_listing_relay_is_not_synced, test_history_sync_without_negentropy) - Result: 39/40 tests passing (1 more than Phase 1 baseline of 38/40)
2025-12-11fix: resolve all fmt and clippy warningsDanConwayDev
Main lib (src/): - Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration) - Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting) - Replace .or_insert_with(RelaySyncNeeds::default) with .or_default() - Replace manual div_ceil implementations with .div_ceil(100) Test code (tests/): - Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...)) - Remove needless borrows in fetch_metrics() calls - Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module grasp-audit: - Apply cargo fmt to fix formatting
2025-12-11refactor: move metrics tests to tests/sync/ structure (Phase 7)DanConwayDev
2025-12-10Phase 8: Create catchup sync stub testDanConwayDev
2025-12-10Phase 7: Implement tag variation testsDanConwayDev
Add comprehensive tests for different Layer 2 and Layer 3 tag variations: Layer 2 tests (Tests 8a-c) - all pass: - test_layer2_sync_with_lowercase_a_tag (standard NIP-01) - test_layer2_sync_with_uppercase_a_tag (NIP-33) - test_layer2_sync_with_q_tag (NIP-18 quotes) Layer 3 tests (Tests 9a-c) - marked #[ignore]: - test_layer3_sync_with_lowercase_e_tag (NIP-01) - test_layer3_sync_with_uppercase_e_tag (NIP-22) - test_layer3_sync_with_q_tag (NIP-18) Layer 3 tests have full implementation but are ignored until Layer 3 sync is enabled in the relay.
2025-12-10Phase 6: Implement live sync testsDanConwayDev
2025-12-10Phase 5: Migrate bootstrap and discovery testsDanConwayDev
Create organized test structure for proactive sync: tests/common/sync_helpers.rs (from Phase 4): - TestClient with retry logic for connect/send - Event builders: build_layer2_issue_event, build_layer3_comment_event - Tag variants (a/A/q for Layer 2, e/E/q for Layer 3) - wait_for_event_on_relay() assertion helper - repo_coord() utility function - Unit tests for all builders tests/sync/mod.rs: - Module organization for sync tests - Documentation of test categories tests/sync.rs: - Main test harness including common and sync modules tests/sync/bootstrap.rs: - test_bootstrap_syncs_existing_layer2_events (Test 1) - test_relay_replays_events_after_restart (Test 4) tests/sync/discovery.rs: - test_discovers_layer3_via_layer2 (Test 2) - test_layer2_discovery_with_chain (Test 3 - simplified) All 14 tests pass: cargo test --test sync