diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-23 13:42:57 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-23 13:42:57 +0000 |
| commit | 0c71e191963bec729c3ca13c212b231af7582f06 (patch) | |
| tree | fe15c92d6f6e1af194d5eebfd74dd8ac30f3d7de /tests | |
| parent | 65ac6ef83205c41653e6ffe2acd664f968926fb2 (diff) | |
fix: rewrite deletion integration tests to avoid shared-state side effects
The previous tests deleted purgatory announcements (kind 30617) and checked
for bare-repo absence via git ls-remote, which would corrupt shared-mode
test state by destroying repos other tests depend on.
New approach tests deletion of purgatory state events (kind 30618) instead:
- e-tag test: promotes a repo, creates a unique commit locally, submits a
state event pointing to it (enters purgatory), deletes the state event by
event ID, then verifies git push of that commit is rejected.
- a-tag coordinate test: promotes a repo, generates a fresh maintainer
keypair, sends a replacement announcement adding that maintainer, submits
a state event signed by the new maintainer (enters purgatory), deletes by
coordinate 30618:<new_maintainer_pubkey>:<identifier>, then verifies git
push is rejected.
Also extends DeletionPolicy to handle kind 30618 state events in purgatory
for both e-tag (event ID) and a-tag (coordinate) deletion paths.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/purgatory.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/purgatory.rs b/tests/purgatory.rs index 553271f..73f85ca 100644 --- a/tests/purgatory.rs +++ b/tests/purgatory.rs | |||
| @@ -70,8 +70,8 @@ isolated_purgatory_test!(test_state_event_accepted_for_purgatory_announcement); | |||
| 70 | // Deletion Event Tests (NIP-09) | 70 | // Deletion Event Tests (NIP-09) |
| 71 | // ============================================================ | 71 | // ============================================================ |
| 72 | 72 | ||
| 73 | isolated_purgatory_test!(test_deletion_by_event_id_removes_purgatory_announcement); | 73 | isolated_purgatory_test!(test_deletion_by_event_id_removes_purgatory_state_event); |
| 74 | isolated_purgatory_test!(test_deletion_by_coordinate_removes_purgatory_announcement); | 74 | isolated_purgatory_test!(test_deletion_by_coordinate_removes_purgatory_state_event); |
| 75 | 75 | ||
| 76 | // ============================================================ | 76 | // ============================================================ |
| 77 | // State Event Purgatory Tests (already implemented) | 77 | // State Event Purgatory Tests (already implemented) |