Skip to content

test: end-to-end integration tests for full mesh lifecycle (#66)#85

Merged
LiranCohen merged 1 commit into
mainfrom
test/e2e-mesh-lifecycle
Feb 26, 2026
Merged

test: end-to-end integration tests for full mesh lifecycle (#66)#85
LiranCohen merged 1 commit into
mainfrom
test/e2e-mesh-lifecycle

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive E2E integration tests that validate the protocol redesign from PR #84 against a real DWN server. These tests cover the critical gaps identified in issue #66.

New Tests

Test What it validates
TestE2EFullMeshLifecycle Complete lifecycle: anchor creates network, registers owner node + member + member node, writes nodeInfo/endpoint for both, runs LoadState and verifies dual-path merging, nodeInfo/endpoint attachment, WireGuard key derivation, and member record tracking
TestE2ERecipientBasedOwnerNodeWrite Regression test for PR #84 fix: non-anchor node writes its own nodeInfo and endpoint using recipient-based authorization — the exact scenario that was broken before the protocol redesign
TestE2EACLPolicyRoundTrip Writes ACL policy with groups, DID-based sources/destinations, and port ranges; verifies LoadState produces correct non-wildcard filter rules with DID-to-IP resolution
TestE2ELoadStateNonAnchor Non-anchor node runs LoadState using network/node role for read authorization, verifying role-based reads work from the joiner perspective

Coverage Gaps Filled

  • Member path (CreateMembernetwork/member/node → nodeInfo → endpoint) — never exercised before
  • WriteNodeInfo — never called in any integration test before
  • Recipient-based write auth — non-owner writing own records, the exact pre-PR#84 bug
  • LoadState dual-path merge — queries 10 record types across both paths, verified end-to-end
  • ACL policy round-tripWriteACLPolicyLoadState → filter rules verified
  • Non-anchor LoadState — role-based reads from joiner perspective

Verification

  • go build ./... — zero errors
  • go vet ./... — zero warnings
  • go test ./... -count=1 -race — all tests pass (integration tests skip without DWN_ENDPOINT)

Closes #66

Add comprehensive E2E integration tests that validate the protocol
redesign from PR #84 against a real DWN server:

- TestE2EFullMeshLifecycle: exercises the complete mesh lifecycle with
  both owner-provisioned (network/node) and member-associated
  (network/member/node) paths, including CreateMember, WriteNodeInfo,
  WriteEndpoint, and LoadState dual-path merging.

- TestE2ERecipientBasedOwnerNodeWrite: regression test for the exact
  scenario that was broken before PR #84 — a non-anchor node writing
  its own nodeInfo and endpoint using recipient-based authorization.

- TestE2EACLPolicyRoundTrip: writes an ACL policy to the anchor DWN
  and verifies LoadState produces correct, non-wildcard filter rules
  with DID-to-IP resolution and port ranges.

- TestE2ELoadStateNonAnchor: verifies a non-anchor node can run
  LoadState using the network/node role for read authorization.

These tests require DWN_ENDPOINT to be set and are skipped otherwise.
They cover gaps not exercised by existing tests: member layer, nodeInfo
writes, dual-path LoadState, ACL round-trip, and non-anchor reads.
@LiranCohen LiranCohen merged commit 9121182 into main Feb 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: end-to-end integration tests for full mesh lifecycle

1 participant