Skip to content

API and WebSocket tests: check the values of the events sent - #54

Merged
michalkucharczyk merged 3 commits into
mainfrom
mku-harness-api-ws
Nov 12, 2026
Merged

michalkucharczyk merged 3 commits into
mainfrom
mku-harness-api-ws

Conversation

@michalkucharczyk

Copy link
Copy Markdown
Contributor
  • Metrics tracker (src/metrics_tracker.rs): counts recorded events in a watch channel, so tests can wait for them. It notifies only when something is subscribed, so production cost is negligible.
  • API test setup matches production: the metrics tracker runs, so /api/metrics/realtime and /api/metrics/live are tested on the in-memory path, not the SQL fallback.
  • API tests: node details, realtime and live metrics, network info, peer topology, node status, enhanced status, peers, timeline.
  • WebSocket tests: events arrive unchanged and in order; the node filter delivers only the subscribed node; metrics payload values.
  • Known bugs, as ignored tests expecting the correct behaviour:
    • /api/slots links Authored to Authoring by insert time: 0 blocks authored instead of 1
    • node event count doubles after disconnect: 8 instead of 4
    • WebSocket event-type and event-type-range filters are not applied

@michalkucharczyk
michalkucharczyk merged commit c70230a into main Nov 12, 2026
6 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.

1 participant