test(e2e): expand mock API fixtures for comprehensive edge-case coverage#10
Open
CJFWeatherhead wants to merge 1 commit into
Open
Conversation
Grows the fixture dataset from ~5 nodes / 2 users to:
- 25 users (local, OIDC/Google, OIDC/Azure, OIDC/GitHub, service accounts,
long names, unicode display names, legacy epoch creation dates)
- 91 nodes distributed unevenly across users + tagged-devices:
- Group A: personal workstations/laptops (mixed online/offline, expiry states)
- Group B: 6 exit nodes (dual-stack approved, IPv4-only, IPv6-only,
unapproved, expiring soon, offline)
- Group C: 8 route-provider nodes (RFC1918 /24, /16, /8, overlapping
subnets, IPv6 ULA, dual-stack, pending approval, many-routes overflow)
- Group D: 22 tagged nodes under tagged-devices (single/multi tag,
k8s cluster, IoT, cameras, printers, orphaned nodes, never-seen node,
tagged exit node, tagged router)
- Group E: edge cases (null lastSeen, IPv4-only, IPv6-only addresses,
REGISTER_METHOD_UNSPECIFIED, multi-IP node, overflow name/givenName)
- 11 pre-auth keys (reusable, ephemeral, used, expired, tagged, multi-tag,
expiring-soon, service-account)
- 3 API keys (healthy, expiring-soon, expired)
- Richer ACL policy (groups, hosts, tagOwners, SSH rules)
- userNodeMap built dynamically from fixture data (includes originalUser
attribution for tagged-device nodes)
Smoke-tested via Docker: 25 users, 91 nodes, 11 preAuthKeys returned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Substantially expands
e2e/mock-api.mjsfrom a minimal 5-node / 2-user dataset to a rich fixture set designed to maximise UI test surface and catch edge cases.Fixture counts (smoke-tested via Docker)
Users (25)
Covers the full provider matrix and edge cases:
ci-bot,deploy-svc)peter-the-very-long-username-that-may-overflow-ui)Sven Åström,Tánya Волкова)vera, created1970-01-01)user-42)ulrich)Nodes (91) — grouped by scenario
Group A — Personal workstations / laptops (50 nodes)
registerMethodvalues includingREGISTER_METHOD_UNSPECIFIEDgivenNameoverride that is unreasonably long (overflow test)Group B — Exit nodes (6)
0.0.0.0/0+::/0), approvedGroup C — Route-provider nodes (8)
/24,/16,/8(very large prefix)172.20.0.0/16+172.20.1.0/24)fd00::/8)Group D — Tagged nodes under
tagged-devices(22)tag:server)tag:server,tag:database,tag:k8s,tag:infra, etc.)originalUser) — including one with an extremely long hostnamelastSeen: null)tag:exit)Group E — Dedicated edge cases
lastSeen: null(freshly registered, never connected)REGISTER_METHOD_UNSPECIFIED(legacy migration artefact)Pre-auth keys (11)
Covers: standard, reusable, ephemeral, already-used, expired, tagged (single), tagged (multi), reusable+ephemeral tagged, expiring within 1 hour, service-account, 7-tag overflow key.
API keys (3)
Healthy, expiring in 7 days, already expired.
ACL policy
Enriched with groups (
admin,dev,ops), named hosts, multi-rule ACLs, fulltagOwnersmap, and SSH rules.Implementation notes
userNodeMapis now built dynamically from fixture data rather than hardcoded; tagged-device nodes are attributed to theiroriginalUserfor the?user=filter, matching real Headscale behaviour.resetState()resets_nodeIdto0so IDs are deterministic across test resets.