test(message-bus): test basic scenario

use a helper to run scenario in hurl like style
This commit is contained in:
Edouard Vanbelle
2026-09-10 00:25:39 +02:00
parent 4a4c83b53a
commit a2d27a61fe
7 changed files with 769 additions and 4 deletions
+30 -1
View File
@@ -31,6 +31,10 @@ axum = { version = "0.8.8", features = ["multipart", "http1", "http2", "tokio",
tokio = { version = "1.52.3", features = ["rt-multi-thread", "macros", "io-util", "net", "time", "sync", "fs", "process", "signal"] }
tokio-util = { version = "0.7.18", features = ["io", "codec", "compat"] }
tokio-stream = { version = "0.1.18", features = ["fs", "sync"] }
# Only pulled in by the `test_utils` feature (rt-hurl-helper bin). Not
# shipped in release; pinned to the same 0.28 axum 0.8.8 already brings
# transitively so we don't duplicate the crate graph.
tokio-tungstenite = { version = "0.28", default-features = false, features = ["connect", "handshake"], optional = true }
bytes = "1.11.1"
tempfile = "3.27.0"
tower = "0.5.3"
@@ -190,7 +194,7 @@ metrics-exporter-prometheus = { version = "0.18", default-features = false }
[features]
default = []
test_utils = ["mockall"]
test_utils = ["mockall", "dep:tokio-tungstenite"]
integration_tests = []
# WASM plugin runtime (Extism). Opt-in: bundles wasmtime, a large engine most
# deployments won't use. Activation also requires OXICLOUD_ENABLE_PLUGINS=true.
@@ -262,6 +266,16 @@ path = "src/bin/generate-openapi.rs"
# Invoked by `just openapi`, which passes `--features dev_tools`.
required-features = ["dev_tools"]
[[bin]]
name = "generate-asyncapi"
path = "src/bin/generate-asyncapi.rs"
# Dev-only: regenerates `resources/gen/asyncapi.json` — the WS surface's
# analogue of openapi.json. Constructed from the same `error_code`
# constants + `Topic`/`RealtimeEvent` shapes the server uses, so the
# spec stays in sync with the implementation by construction. Same
# gating as `generate-openapi`. Invoked by `just asyncapi`.
required-features = ["dev_tools"]
[[bin]]
name = "opaque-hurl-helper"
path = "src/bin/opaque-hurl-helper.rs"
@@ -292,6 +306,21 @@ path = "src/bin/load-seed.rs"
# and load-nightly.yml build it explicitly with --features load_seed_bin.
required-features = ["load_seed_bin"]
[[bin]]
name = "rt-hurl-helper"
path = "src/bin/rt-hurl-helper.rs"
# Test-suite WebSocket client for the realtime message bus. Hurl is
# HTTP-only and cannot drive a WS handshake or read frames; this bin
# supplies the two modes the smoke test needs — `subscribe-and-collect`
# (background subscriber that captures events to JSON) and
# `expect-denied` (synchronous check that a subscribe attempt is
# rejected with a specific JSON-RPC error code). Invoked from
# tests/api/rt_bus_check.sh after the main hurl block.
#
# Not shipped in release: gated behind `test_utils` alongside the
# opaque/dpop helpers.
required-features = ["test_utils"]
# Phase 0 perf harness — Task 0.2 (criterion latency + output-size bench).
[[bench]]
name = "thumbnails"