upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/common/purgatory_helpers.rs
AgeCommit message (Collapse)Author
2026-01-08refactor: replace hardcoded Kind constants with rust-nostr variantsDanConwayDev
- Replace KIND_REPOSITORY_ANNOUNCEMENT with Kind::GitRepoAnnouncement - Replace KIND_REPOSITORY_STATE with Kind::RepoState - Replace KIND_PR with Kind::GitPullRequest - Replace KIND_PR_UPDATE with Kind::GitPullRequestUpdate - Replace KIND_USER_GRASP_LIST with Kind::GitUserGraspList - Replace KIND_PATCH with Kind::GitPatch - Replace KIND_ISSUE with Kind::GitIssue - Replace KIND_COMMENT with Kind::Comment - Replace all Kind::Custom(30617|30618|1617|1618|1619|1621|1111|10317) patterns - Remove all hardcoded KIND_* constants from events.rs - Update all match statements to use Kind enum directly - Update all filter builders to use Kind variants - Update all test helpers and assertions Benefits: - Type safety: compiler prevents wrong kind numbers - Readability: Kind::GitRepoAnnouncement is self-documenting - Maintainability: single source of truth (rust-nostr) - IDE support: full autocompletion and refactoring - Standards: aligns with rust-nostr best practices Files modified: 21 Constants removed: 9 Patterns replaced: 100+ Tests passing: 222/222
2026-01-08chore: cargo fmtDanConwayDev
2026-01-08test: disable GPG signing in all test helpersDanConwayDev
Prevent GPG signing prompts (including Yubikey activation) during test runs by explicitly disabling commit.gpgsign and tag.gpgsign in all test repository creation helpers. Modified: - tests/common/purgatory_helpers.rs: create_test_repo_with_commit() - src/git/mod.rs: create_test_repo_with_commit() - src/purgatory/helpers.rs: create_test_repo_with_commit() All test repositories now have GPG signing disabled regardless of global git configuration.
2026-01-07test: added purgatory git data sync intergration tests agregating from ↵DanConwayDev
mulitple git servers
2026-01-07test: add test_pr_event_syncs_from_remoteDanConwayDev
2026-01-07Add purgatory sync test helpersDanConwayDev
Add tests/common/purgatory_helpers.rs with utilities for purgatory sync integration tests: - Git repository setup helpers (create_test_repo_with_commit, add_commit_to_repo, create_branch) for deterministic test commits - State event creation (create_state_event) for kind 30618 events with refs/heads/*, refs/tags/*, and HEAD tags - PR event creation (create_pr_event) for kind 1618 events with a and c tags - Purgatory state inspection helpers (wait_for_event_served, verify_event_not_served) for polling event availability - Git ref verification (check_ref_at_commit) for validating remote refs - Push helper (push_to_relay) for pushing local repos to relay All helpers include comprehensive unit tests verifying correct tag structure and git operations.