Repository navigation
test(api-conformance): Add a Conformance Suite for the HTTP API - #26257
Conversation
Start of a black-box conformance suite for the BBB HTTP API, so bbb-web and bbb-api can be checked against the same cases. This first part defines the YAML case format as a JSON Schema (runner/schema/case.schema.json) and adds `bbb-conform validate`. It checks cases against the schema and against what a schema can't express: templates and variable references, capture expressions, XPath, JSONPath and regex syntax, fixture files, known tags and capabilities, and unique case IDs. Variants and YAML anchors are expanded when a file loads, and every problem is reported with its file and line. The shapes of the step types that come later (presence, graphql, bus, fs, redis, sink, env) are defined now, so cases can be written against the whole format. The README documents it, and runner/testdata/cases holds a worked example of each feature.
Second part of the runner core: bbb-conform now runs cases against a target and reports PASS, FAIL, ERROR or SKIP per case, on the console and as JUnit XML and JSON. - The signer hashes callName + query + salt over the exact string sent and places the checksum first, in the middle or last. It covers every sign mode (valid, uppercase, bad, duplicate, none) and is checked against bbb-web's and bbb-api's test vectors, recomputed with coreutils. - Requests keep params in order, encode like Java's URLEncoder, and can carry XML, form, JSON, raw or multipart bodies, chunked if asked. The client speaks HTTP/1.1, doesn't follow redirects and keeps a cookie jar per named client. - Responses are checked with XPath 1.0, RFC 9535 JSONPath, header, redirect and top-level response checks. `eventually` polls until a condition holds, and captures feed later steps. Teardown always runs. - The salt and secret target vars are redacted from everything written. - Step types that aren't implemented yet, route steps and response schemas make a case SKIP before anything runs. Self-tests run the CLI over TLS against an in-process fake bbb-web and compare the reports with reviewed golden files. testdata/smoke passes against a live bbb-web 4.0.0-rc.2.
- Commit internal/target. The repository's **/target/* rule ignored it, so the runner didn't build from a clean checkout. The suite's .gitignore now re-includes it. - Redact secrets in every encoded form they reach a report in: query, path, JSON and XML. Use [salt]/[secret:name] labels, which need no escaping, so the final pass over serialized reports can't break XML. - eventually: cap each attempt's timeout at the time left before `within`. If the last attempt can't connect, report the last real answer as a FAIL instead of an ERROR. Reject `every` under 10ms and a `within` of 0. - Encode params, form fields and urlencode() exactly like Java's URLEncoder: keep *, escape ~. - Expand templates in header and redirect-query matcher keys. - Clip long values at a character boundary. - run uses the fixtures directory that validation resolved.
Lets the suite run against more than one implementation and report
what differs.
- Target routes and profiles.
- `route` steps now run: a target maps route names to paths, filling
{placeholders} from pathParams, and can send a route to another
base for the nginx-internal hooks that cases call on bbb-web
directly. A route the target can't reach makes the case SKIP as
not-routed.
- A case's `profile` selects one of the target's config profiles.
Profiled cases run last, one group at a time, after the profile's
command, but only if a case in the group will actually run. The
`default` command restores the target afterwards, even after an
interrupt.
- targets/bbb-web.yaml (its routes taken from UrlMappings.groovy and
bbb-web.nginx) and targets/bbb-api.yaml.
- Expected failures. `run --expect FILE`:
- a listed case that fails is XFAIL;
- a passing case listed by its own ID is XPASS, which fails the run
so the stale entry gets removed;
- variants listed by their base ID count as a group, XPASS only once
every variant passes;
- a passing case covered only by a glob (a missing endpoint) stays
PASS.
expectations/bbb-api.yaml seeds the bbb-api gap backlog.
- A response normalizer, which record mode will reuse. It turns a
response into ordered path/value lines. It masks values that change
per run (times, Java dates, sha1(meetingID)-time IDs, w_ user IDs,
generated passwords and voice bridges, tokens and checksums,
including inside URLs and cookies), substitutes ${uid}, ${baseUrl}
and ${apiPrefix}, drops other cases' getMeetings entries, and sorts
lists whose order isn't defined. masks.yaml can add rules.
- `bbb-conform diff`:
- compares two targets response by response, with ContinueOnFail so
every step gets an answer and captures still feed later steps;
- each side gets its own ${uid}s, and getMeetings cases run alone,
last;
- teardown and golden: off steps aren't compared.
- `bbb-conform gap`: a Markdown and a self-contained HTML grid of cases
against targets, built from the run reports.
- fakebbb.NewAPI: a fake with bbb-api's response format (202,
application/xml, returnCode and moderatorPw in create, a
case-sensitive checksum comparison, five calls), to test all of this
while the port can't run on 4.0.
Tests:
- fake bbb-web against fake bbb-api shows the format differences;
- fake bbb-web against a fake with other clocks and tokens shows none,
and does show them once the createTime mask is disabled.
Live, bbb40 against itself shows no differences on testdata/smoke and
testdata/cases.
…alike With no checksum, bbb-web answers "You must provide the checksum" or "Checksums do not match" at random, because two checks put different messages under the same error key. diff caught this live, as a difference between two runs on the same server. masks.yaml now treats the two messages as one.
…lden Record mode will collect, store and check the same normalized step output that diff compares, so the collector, step keys and the line diff move to a package of their own. diff reads a case's steps through Collector.Steps. No change in behaviour.
…eps default to off The collector skipped golden: off steps before noting what they sent, so a later step echoing such a value read <random> or <sha1(?)>, and whether it did depended on the earlier step's setting. Every observed step now counts as sent; only off steps' responses are left out. Steps with ignoreResult default to golden: off, since their answers may vary by design. The default resolver is exported as steps.GoldenMode for record mode.
…tings bbb-web adds an empty <meetings/>, messageKey noMeetings and its message only when the whole server has no meetings. Scoping drops other cases' meetings, so whether a case's normalized getMeetings answer had those lines depended on what else was running: a recording of it couldn't be stable. A list whose children were all dropped now reads like an empty one, and a new drop rule removes lines by path and, optionally, value. The built-in drop rules remove getMeetings' noMeetings messageKey and message; cases check those with expect, which sees the raw response.
run will compare each step with its recording before expect, and refuse cases whose recording is missing or stale before they send anything. - Observe now returns check results and an error. Its results count as the step's first checks, also when an eventually runs out of time; an error makes the step ERROR. diff's collector returns none. - Before sees each case that will run before it sends anything; an error makes the case ERROR. - Collector.Add returns a step's lines, for record mode and run.
A recording holds one case's normalized step output, one file per case ID at <dir>/<endpoint>/<id>.txt, in plain text so a pull request shows each changed field as a one-line diff: case create.x.y target bbb-web == step 1: call create status 200 ... - A case's sections follow from the case alone: every step that takes golden and isn't off, labelled with what it does and marked when it is document. A recording whose sections differ is stale. - Build makes a recording from collected steps and fails if a section's step wasn't reached. - Leaks spots the salt's placeholder or a redaction label, so such a recording is never written. - Files are written atomically, and not at all when unchanged.
record runs the cases against a target and writes each case's
normalized answers to golden/<target>/<endpoint>/<case ID>.txt, for
review before they become the expected results.
- Every case runs --passes times (default 2) in one go, each copy with
its own ${uid}, so profiles switch once. A case whose answers or
outcome differ between passes is UNSTABLE and isn't written, with the
lines that differ, so a mask can be added.
- A case that skips, errors, doesn't reach a step (INCOMPLETE) or whose
answer holds a secret (SECRET) isn't written either.
- Hand-written checks don't stop a case. When one fails the recording is
still written and the failure shown: expected in a defect case, to be
resolved otherwise. A defect case that passes is flagged.
- Unchanged files aren't touched, recordings of cases that no longer
exist are listed, and an output path with a directory named target
(ignored by the repository's .gitignore) gets a warning.
diff and record share how they load masks and run cases, getMeetings
cases last; the collector redacts its lines. Self-tests record
testdata/cases and testdata/smoke against the fake, and cover each
outcome with a scripted server.
run --golden DIR compares each compare step's normalized answer with the reviewed recording, before the step's expect, normalizing with the same masks as record (--masks, or masks.yaml next to the cases). - Each line that differs fails the step as its own check, a removed and an added line about the same field paired up, e.g. recording /response/returncode: expected "SUCCESS", got "FAILED". At most 20 per step are listed. - A case with something to compare and no recording, or a stale one, is an ERROR before it sends anything, so expected-failure lists can't hide it. document steps aren't compared. - Recordings of cases that no longer exist give a warning. Tests record testdata/cases and testdata/smoke and run them against a fake with other clocks and tokens, and against fake bbb-api, whose differences from the recordings become the expected failures.
review shows recordings beside the cases they record (ID, title, class, file and the case itself), so each answer can be checked against what the case is about before it is committed. - --since REV shows only the recordings added, changed or removed since that git revision, changed ones diffed section by section. The old versions come from git show and git ls-tree, since fresh recordings are untracked and git diff wouldn't see them. - Without --since, cases that should have a recording and don't are listed as missing, and recordings without a case as orphaned. - --html also writes one self-contained page; html/template escapes the recorded answers.
A case whose step failed before a later one was reached was reported INCOMPLETE and also "expect failed ... Recorded anyway", though nothing was written. INCOMPLETE now names the failure that stopped the case, and only written recordings carry the expect note. Seen live on bbb40.
- The built-in noMeetings drop rules were anchored to XML paths, so a JSON answer kept them. They now match both, like the scope rule. - record and diff no longer run getMeetings cases alone after the others. Normalization already keeps only a case's own meetings, and run doesn't isolate them, so recording and checking now run cases the same way. Live on bbb40 at --parallel 8, recordings without the split are identical to those with it. - An UNSTABLE case also points at isolation: copies of a case may run at the same time, so a case other cases disturb needs the serial tag. - run --golden no longer keeps every normalized answer for the whole run, nor normalizes document steps it never compares. - diff and record line up two collections of steps with one helper, golden.Pairs. The unused Step.Golden field is gone. - run --masks without --golden is a usage error instead of being ignored; review reports an unexpected argument as such. - review reads each case file once, not once per variant; record warns about a directory named target once.
The presence driver dials the GraphQL websocket itself, so it needs the target's TLS settings outside an http.Transport, and the JSESSIONID that a user's join left in that user's cookie jar.
presence and graphql steps now decode into types that keep their
matchers and line numbers, ready for the runner, which still skips them.
- presence: action is join, leave, disconnect or reconnect. A join takes
exactly one of joinUrl, args (join params, signed like a call step's)
and sessionToken (the session a call step with client: <as> began).
expect has jsonpath only.
- graphql: query must hold one named operation, since its name is sent
with it, and not a Patched_ one. Values go in variables, not in the
query. A mutation must have the one shape bbb-graphql-middleware can
route: mutation Name($a: T!) { action(arg: $a) }, every argument a
variable that variables gives. It is sent rewritten in a canonical
form, so the middleware's regular expressions always read it the same.
- graphql gains timeout and eventually (queries only, every at least
300ms: the middleware delays more than 200 queries a minute), and
expect.errors, matched against each error message.
- A graphql or non-join presence step must name a user an earlier step
joined.
internal/presence speaks to bbb-graphql-middleware the way the HTML5 client does, over golang.org/x/net/websocket (already in the module graph, now a direct dependency): - Dial sends the join's cookies, the target's base URL as Origin and the graphql-transport-ws subprotocol, then connection_init with its headers, and waits for connection_ack. The middleware's id -1 error frame becomes a *Rejected with its messageId. - Do runs a query or mutation, or takes a subscription's first answer; when its context ends the server is told to stop the operation. Subscribe streams every frame of a subscription to a callback. - Frames are compact JSON without HTML escaping, so a mutation's frame holds "query":"mutation, which is how the middleware routes it. - One reader goroutine answers pings and hands frames to operations by id, dropping answers nobody waits for; another pings every 20s, since the middleware drops a connection that is silent for a minute. Close ends every waiter and waits for both.
The fake gains a stand-in for bbb-graphql-middleware, Hasura and the GraphQL actions, enough to test the presence driver without a server: - The handshake checks the subprotocol, Origin, the join's JSESSIONID and the connection_init headers, and rejects with the middleware's id -1 frame (check_authorization_error, meeting_not_found, too_many_connections, param_missing). - Before a user joins, only the middleware's allowlisted queries are answered; others are held and answered after the join. Mutations go to the actions, which have no allowlist. - user_current as a query or a subscription that pushes changes; user, which fails once right after a join, as it does until the session variables are refreshed; userJoinMeeting, userLeaveMeeting, userSetPresenter, userSetRole and guestUsersSubmitApprovalStatus. - join answers like bbb-web: redirect=false gives user_id, auth_token, guestStatus and url; a guest of an ASK_MODERATOR meeting waits; JSESSIONID covers / as on a real server (two goldens change). - isMeetingRunning is true only while a user is in and connected (ended meetings keep their end polls). The eventually-timeout example now waits for a run that never starts.
A presence.User is one headless user, joined the way the HTML5 client joins: - Attach dials for the session a join began and follows the user's user_current row through userCurrentSubscription, one of the few operations the middleware answers before a join. It retries a user_not_found or meeting_not_found while akka-apps catches up, and explains a check_authorization_error. - Join sends userJoinMeeting with the auth token user_current gave, and waits for joined. A guest who must wait is left waiting; a later Join that asks to wait for approval joins once the guest is allowed. A denied guest, a join error, an eject or a logout fail it. - Once joined, Join waits until the in-meeting user view answers, since akka-apps refreshes the session's role after the join. - Query runs an operation as the user, refusing a query the middleware would silently drop before the join. Leave logs out; Disconnect drops the connection; Reconnect opens a new one for the same client and joins again if the user was dropped meanwhile. - Snapshot is the user's state as a document: user_current without the presenter, locks or auth token, which a join leaves to chance or keeps secret, plus the session token. Checked live on bbb40: two users joined in about 300ms, isMeetingRunning said running, getMeetingInfo counted them, a presenter change showed up in the new presenter's user_current, and a leave logged the user out.
The runner now runs the two step types it used to skip. - presence join signs the step's args like a call step's join, or opens its joinUrl, in the cookie jar of the client named by as, or takes the session a call step with that client began. It then connects the user and joins them. A second join on a waiting guest waits for approval. leave, disconnect and reconnect act on the joined user. The step's document is the user's state; a failed join stops the case, even in diff and record mode. - graphql runs the step's operation as the user, with its variables' templates expanded. Its document is GraphQL's data and errors; when no result comes, because the server closed the connection or never answered, the document holds that as an error. Errors fail the step unless expect.errors is given, which is matched against each message. eventually polls a query until its until holds. - Both report their document and check it with jsonpath and captures, after the Observe hook; graphql reports its request as GRAPHQL. - Users' connections close when the case ends, whatever happened. - Targets gain graphqlUrl, by default the base URL's host at /graphql. The collector accepts steps that send no HTTP request.
What a presence or graphql step returns is a JSON document, not an HTTP response, so it is recorded as the document's lines alone, normalized like a JSON body (normalize.Document). The HTTP path is unchanged. - Built-in masks for GraphQL's names of values that change from run to run: userId and extId as user IDs, meetingId and parentMeetingId as internal IDs, registeredOn and registeredAt as times. The time mask also takes ISO-8601 timestamps. - Recording sections name what the step does: "presence join as ann", "graphql query Me as ann".
Two worked examples in testdata/cases, which the self-tests run, record and diff against the fake: - join.presence.two-users: a moderator and a viewer join, the meeting runs, the moderator makes the viewer presenter, the viewer sees it (eventually) along with the avatar the join set, and logs out. - join.presence.guest-approved: a guest of an ASK_MODERATOR meeting waits, a moderator approves them, and a second join on the guest continues the first. A second join on a user who joined already takes no join source: it continues that join. The CLI tests' fake targets declare presence; the fake keeps joined set after a logout, as bbb-web does.
A deferred assignment set a step's duration on its local copy after the result had been returned, so every step reported 0ms. Seen in a live run's JSON report.
- README: the two step types run now. A Users section covers joining (args, joinUrl or a call step's session), guests, leave, disconnect and reconnect, what a join returns, the graphql rules (one named operation, values in variables, the mutation shape the middleware can route, no queries before a join, errors, eventually), and the signatures of the actions later cases need. Targets gain graphqlUrl; the new masks and section names are listed. - targets/bbb-web.yaml and bbb-api.yaml declare presence. - The guest example declares the approval list with the action's own type.
- An answer the server sent just before closing the connection is the operation's result, not the close's error; likewise a wait for the user checks the last state the connection delivered before failing. - When the server stops following the user (user_current ends), waits fail at once with why, instead of at the timeout. - Leave reports userLeaveMeeting's errors, and accepts the server closing the connection of a user who left. - A join on a user whose connection was dropped says to reconnect first, instead of passing on stale state. - The readiness probe waits 300ms between tries, under the middleware's 200 queries a minute. - A graphql step's eventually caps each attempt at the time left, as a call step's does, and a broken check stays an ERROR when it runs out. Tests cover the closed-connection answer, the lost subscription, leave errors and a join without a connection. Checked live on bbb40 again.
bus, fs and redis steps now decode into types that keep their matchers
and line numbers, ready for the runner, which still skips them.
- bus: name, channel, meetingId, within. A bus step needs a meetingId
unless its case is tagged serial, since other cases' messages would
match too, and it must be an internal meeting ID, not ${uid}.
- fs: a path relative to the data directory, which may be a glob and
may not leave it. redis: a key. within is optional for both.
- expect: absent (nothing matches in the whole window), exists, count
(bus, new in the schema), contents, hash, members (the exact set) and
ttl. A step asks one question: absent doesn't go with count, exists or
a capture, and exists: false doesn't go with filters.
The tap reads the server's redis with internal/resp, a small RESP2 client that adds no module: commands go out as arrays of bulk strings, replies are read by type, bulk strings by their length (payloads hold CRLF), with null bulk strings and arrays, and error replies as *Error without losing the connection. Subscribe waits until redis confirms every channel, and Receive returns messages and pongs. ParseURL reads redis://[user:password@]host[:port][/db]; Dial logs in and selects. internal/fakeredis is an in-memory redis for the tests, with its own command parser: the read commands, AUTH, SUBSCRIBE and PING, Go methods to set keys and publish, Kill to drop every connection, and the list of commands it received.
The tap, which runs next to the server, starts with what it keeps: - A log of what it saw, bus messages and file events alike, numbered by one sequence, so a case can scope its checks to "since my mark" without comparing clocks between hosts. It is capped by size and age; a reader that asks for entries already dropped is told so. Entries never change, so readers don't hold the lock while filtering, and Wait wakes on the next append. - The meeting IDs a message is about. Where a message keeps its ID depends on the message: the header for most, only the body for system messages (props.meetingProp.intId for MeetingCreatedEvtMsg, meetingId for MeetingEndedEvtMsg, recordId for the recording messages); a breakout room's creation is about both the parent and the room. - A file watcher using inotify through the standard library, recursive, which adds new directories and reports the files already in them. It sees a recording marker that record-and-playback deletes the moment it appears. Off Linux it is a stub, and the tap only sees files that exist when asked.
bbb-conform tap runs next to a BigBlueButton server and serves what the runner can't see from outside, over HTTP: - /mark: where a case starts looking, a sequence number and the tap's instance. It answers 503 until every channel is subscribed. /info says what the tap follows and whether redis is reachable. - /bus: the messages after a mark, by name, meeting ID and channel, waiting up to 30s for a first match. It follows the four channels akka-apps and bbb-web use unless told otherwise, reconnects with backoff, PINGs a quiet subscription, and reports a gap where it may have missed messages. - /redis: a key's type, TTL and value, for keys matching an allowlist (meeting:*, recording:*, captions:* by default), on a second connection that only sends read commands. - /fs: the files matching a glob under the data directory, read through an os.Root so nothing outside it can be reached, and the files that appeared since the mark, which the watcher saw even if they're gone. It is unauthenticated and listens on 127.0.0.1 unless told otherwise: for test servers only. tap.Client is the runner's side of it.
- Only a join akka-apps refuses with a join error code counts as an
expected refusal: a denied guest or an ejected user still fails the
step, even one that checks $.joinErrorCode is absent.
- A user whose refusal was expected is dropped: a later step as them
errors at once, and a later join starts afresh, instead of acting for
a user who never joined.
- The check names $.joinErrorCode in bracket form too.
- fakebbb lets a bot in at maxParticipants, as akka-apps does.
- The README says which refusals a step can expect.
- Counts use the {count: N} matcher, as the other cases do.
- The logout URL mask only matches a whole path segment or query value.
|
Follow-up review (adversarial round, five parallel reviewers over runner code, cases/recordings, Tier 1 fidelity, CI, and security) plus a full test-battery rerun at head I re-ran the full test battery on the new head and everything passes, but I'd still hold the merge. None of the three decisions from the previous round has been addressed: the files involved are unchanged since (b) Head reviewed: (a) FindingsFive reviewers each took one area: runner code, cases and recordings, Tier 1 fidelity, CI, and security. I re-checked the key line numbers myself. The three decisions from last round
MajorNEW
Carried over
MinorNEW
Carried over
Partly fixed: headless-user steps are now used ( Withdrawn: my earlier note that (c) Test battery at
|
| Suite | Result | Time |
|---|---|---|
Runner formatting and vet (gofmt, go vet on Linux and darwin) |
clean | <10s |
Runner self-tests (BBB_CONFORM_SUITE=1 go test -race -count=1 ./...) |
214 top-level tests (292 including subtests) pass, 0 fail. One test skipped locally (no pdfinfo); it passes when run in a container that has it |
107s |
Case and recording validation (bbb-conform validate) |
709 cases in 224 files, all recordings current | <5s |
Build the debs (make -C env debs) |
ok | 20.5m on the PR's base; 15m on the merge |
| Tier 1, the CI command, 3 runs | 696/696, 696/696, 696/696, 0 skipped (709 minus the 13 slow) |
about 268s each |
Tier 1, the 13 slow cases (never run by CI) |
13/13 pass | 18m36s |
| Can it fail? (hand-edited one sink recording, then reverted) | that case fails, rc=1 | <1s |
Tier 1, PR merged onto the current v4.0.x-develop tip 63b4de099e |
696/696; the merge is clean | 271s |
Real BBB 4.0 built from source at the PR head, tap on the server, no sink, disruptive and slow excluded |
653 pass, 0 fail, 9 skipped, rc=0. The skips are the sink cases, and they show the "skips don't fail" problem | 53s |
Upstream CI on ce3c81387b (checked with gh) |
"bbb-web on Tier 1" passed, 687/687, deb cache hit, 7m49s; runner self-tests and automated-tests passed | - |
I couldn't run the end-callback cases against the real server, because that needs the sink reachable from it with a trusted certificate (the README's Tier 2 setup). They do run on Tier 1. The disruptive cases also weren't run against the real server: switching profiles restarts the packaged bbb-web, which the dev-mode server doesn't use. They pass on Tier 1. I didn't check upstream CI on a6940fd0ad itself.
(d) Verdict
Not ready to merge. Every check passes, the suite works, and it can fail when it should. But none of the three decisions from last round has been made. The new commits pin more undocumented behaviour as contract and add a whole tier of tests (slow) that no CI job runs. Before merging I would want:
- the questionable quirks moved to
defectortriage; - token authentication on the tap and the sink;
- either a scheduled job for the
slowcases, or those recordings left out until one exists; - skips counted as failures in CI.
gopkg.in/yaml.v3 is archived; go.yaml.in/yaml/v3 is its maintained continuation, under the YAML organization, with the same API.
- run --fail-on-skip fails a run in which any case was skipped, for CI, where every case selected should run. - run, record and diff refuse filters that select no case (exit 2), so a misspelt --id or tag no longer makes an empty run that passes. - diff reports a case that passes on one side and fails on the other as differing, even when the normalized answers match. - validate refuses an absent step without a within longer than 0, sink steps included, and an absent (or count 0) sink step on a key no URL in the case sends requests to: neither could fail.
Killing a profile command's process group is Unix-only, so it moves to a file of its own; elsewhere cancelling kills the process. The runner job vets the Windows build.
- The tap and the sink take a bearer token from BBB_TAP_TOKEN and BBB_SINK_TOKEN, and won't listen on an address other hosts reach without one. The tap needs it on every endpoint but /info, the sink on /_received; recording and fixtures stay open, since the server under test sends no token. The runner sends the tokens from the same variables and redacts them. Tier 1 makes both once. - The sink's /_received answers only requests addressed to an IP address, localhost or a --hosts name, as the tap does. - Generated fixtures are computed as they are sent instead of built in memory. - The sink and the tap open regular files only. - The sink records why it couldn't answer a request as its URL asked (an unknown modifier, a missing fixture), and a sink step that sees such a request ERRORs instead of passing on a request the server got an error for. - The sink records the path as sent, and sink steps can filter on the body. - The tap refuses a --max-mb or --max-age that isn't positive.
- bbb-web starts without -Dspring.main.allow-circular-references, as bbb-web.service has since a6c8e4d. - env/tier1/check-copies.sh warns about the package files Tier 1 mirrors by hand (units, install scripts, Depends, akka-apps' preinst, the LibreOffice converter) that changed since it last followed them, from the hashes in copies.sha256. - Services restart when they exit, as the packages' units restart theirs. - A profile switch restarts akka-apps too when it changes clientSettingsOverrideStrictValidation, which akka-apps reads; make reset holds the switcher's lock throughout; up and reset give up after 15 minutes instead of waiting forever on a service that never gets healthy. - The extensionless scripts are executable, so the repository's ShellCheck job finds them; convert.sh quotes its temporary directory.
A case is compat when bbb-web following the docs to the letter would fail it; each one now names the doc it goes beyond: the meetingExpireWhenLastUserLeftInMinutes delay counting from akka-apps' removal, a user who left keeping a maxParticipants seat, voiceBridge values that aren't 5 digits, create's key for a missing meetingID, ASK_MODERATOR and ALWAYS_DENY applying to viewers who aren't guests, and ALWAYS_ACCEPT_AUTH, which no doc lists. They are still compared. The left-user case also checks the seat is still held 50 seconds after the removal rather than 55, for more margin.
…tizer - The retry, retry-schedule and timeout cases bound each attempt in time with count windows, 10 seconds either side of when it is due, so attempts sent back to back, or late, fail; before, only the number of attempts was checked. On Tier 1 they came 30, 90, 210 and 510 seconds after the first, and 40 after a timed-out one. - api.md documents the end callback, not its retries, timeout or redirects, so those cases are compat, every retry variant alike. - Each welcome-message variant states what must be left of the message, and the bus step checks it, so a sanitizer change can't pass on a re-recording alone.
- getMeetings.checksum.missing-message, a defect case: a call without a checksum should always say it is missing, where bbb-web says that or "Checksums do not match" at random. Sixteen requests must all be right; expectations/bbb-web.yaml lists it, so it XFAILs on bbb-web. - The removed enter and feedback calls answer 404, as guestWait does. - The expiry cases no longer need the sink: the end callback a meeting that ends by itself sends is a case of its own, end.callbacks.expired. - end.callbacks.http sends an https meetingEndedURL too, which must arrive, so the http one not arriving means something on a server that can't reach the sink. - The README says case files are YAML 1.2, where golden: off is a string.
- The Tier 1 job moves into automated-tests.yml: it needs build-package and starts the stack from the debs that job made, instead of building them again (about 17 minutes on a cache miss, which most runs were). A light job checks the changed paths first, so a change that touches nothing the suite tests doesn't start it. build/** becomes the build scripts and package templates the five debs use. It runs with --fail-on-skip, and annotates the run with check-copies.sh's warnings. - The slow cases, which no job ran, run every night: an api-conformance-slow job in nightly-tests.yml, from the packages of the build that workflow tests. - api-conformance.yml goes. The runner job gets a timeout and a concurrency group.
- The Tier 1 jobs take the five debs from all-bbb-artifacts: unify-artifacts deletes the per-package artifacts once it has gathered them, so the nightly job could never find them and the per-PR job raced the deletion. The per-PR job now waits for unify-artifacts. - The sink's /_received answers to the names its certificate covers too: without BBB_SINK_READ_URL the runner reads the sink by the server's name for it, which the Host check had started refusing. - A profile switch that fails before akka-apps has restarted leaves a marker, so the next switch restarts it even though the file no longer changes; profile.sh waits up to 20 minutes for the lock, longer than a reset can hold it, and reads bbb-web's container once it has the lock. - The tokens' env_file is optional, so compose commands work before the first render (Compose 2.24 or later). - diff redacts the tokens too: both register secrets through steps.AddSecrets. - The tap and the sink share their Host and bearer-token checks (internal/guard). - Generated fixtures are copied in runs, not computed byte by byte: about 1 ms for 64 MiB instead of 110 to 190.
New case end.lifecycle.users: after end, a user who had joined reads in their own state that they are logged out and out of the meeting, which ended from the API, and akka-apps tells every client to disconnect. api.md says end kicks all participants out; nothing checked it. join.role.rejected's header now names the doc it goes beyond, as the other compat cases do: join.tsx says a failed join redirects.
|
Thanks for both rounds. I checked every point against the code, the docs and Tier 1. Most were right and are fixed in the commits listed at the end. Where I disagree, I say why. The three decisions1. bbb-web quirks pinned as expected answers. The README defines
They stay compared rather than The random missing-checksum message is a real defect, so it is now a
2. Tokens on the tap and the sink.
3. CI cost. The Tier 1 job moved into
Narrowing paths barely changes the trigger rate. Over the last 186 merged v4.0 PRs it ran for 65 (35%, not 41%), and 63 with Other points
Not changed
Verified
Commits:
Since then, and not from the review:
|
✅ Automated tests have passed! |
|
@imdt-claudiop please review again. |
|
Third round: I verified the fix commits against every finding from my previous comments (five reviewers, one per area, key points re-checked by me) and re-ran the whole battery on I checked the author's fixes against the code and re-ran everything on the new head, and I think the PR is now ready to merge. All three merge-blocking decisions from the earlier rounds are addressed, and nothing blocker- or major-level is left. What remains is minor and only affects the test harness, not BigBlueButton itself. (b) Head reviewed: (a) Did the author fix what we raised?I didn't take the reply at its word: five reviewers each checked one area, and I re-checked the key lines myself. The three merge-blocking decisions
Round-2 findings
NEW findings (all minor or nit)Minor
Nits
(c) Test battery on
|
| Suite | Result | Time |
|---|---|---|
Formatting, and go vet / go build on linux, darwin and windows |
clean, all pass | <10s |
Runner self-tests (go test -race -count=1) |
231 top-level tests (315 including subtests) pass. One skipped locally (needs pdfinfo); it passes in a container that has it |
113s |
| Case and recording validation | 753 cases in 259 files, all recordings current | <5s |
check-copies.sh |
no warnings | <1s |
| Build the debs | ok | 9.6m (head), 8.3m (merge) |
Tier 1, the exact CI command (--fail-on-skip), 3 runs |
738 passed + 1 expected failure / 739, 0 skipped, each time | 278s each |
end.lifecycle.users stress test, 4 at a time |
60/60 | 56s |
| Tier 1 slow tier (the nightly's command) | 14/14 | 17m45s |
| Can it fail? (hand-edited a recording, reverted) | that case fails, rc=1; an --id matching nothing exits 2 |
<1s |
Tier 1, PR merged onto the v4.0.x-develop tip |
738 + 1 expected failure / 739, 0 skipped | 294s |
| Real BBB 4.0 server built from source at the PR head, tap and sink both behind tokens | 703 passed + 1 expected failure / 704, 0 skipped; all 8 callback cases came through the sink | 79s |
| Same real server, slow tier | 14/14 | 17m46s |
| Upstream CI on this head (checked with gh) | conformance job passed (738 + 1 expected failure / 739, 8m54s); runner tests, the 8 Playwright shards and the plugin tests all passed | - |
Not run against the real server: the 35 disruptive cases. They switch bbb-web's config by restarting the packaged service, which the dev-mode server doesn't use. They pass on Tier 1.
(d) Verdict
Ready to merge, in my view. Every merge-blocking decision is addressed, every Major from round 2 is fixed, and the whole battery passes on Tier 1, on the merge with the current tip, and on a real 4.0 server. The real-server run is the first with callbacks, both tokens and the slow tier. The new findings are minor and can reasonably be follow-ups: the relabel leftovers, check-copies being advisory only, the sink's Host check and wildcard certificates, and the missing timeouts.
Brings v4.0.x-release at f31e684, the 4.0.2 release candidate (bigbluebutton-release 4.0.2, no tag yet), into v4.1.x-develop at 3e18924. The merge base is tag v4.0.1 (6e66d4f), merged into 4.1 by #26346. 356 commits (288 non-merge) from 60 pull requests and 1522 files come in; 1315 of those files are the new API conformance suite (bigbluebutton-tests/api-conformance, #26257). 51 files changed on both lines; 22 of them conflicted (21 content, 1 delete/modify). Version and build markers keep the 4.1 values: .gitlab-ci.yml keeps the 4.1 bbb-build image and bigbluebutton-release stays 4.1.0-alpha.1. Translated locales stay as on 4.1: eu.json and it_IT.json, the two that 4.0.2's Transifex sync (#26402) changed. en.json merged normally: 4.0.2 replaces originalAudioDesc with originalAudioSummary and originalAudioIdealFor (nothing reads the old key any more) and keeps the 4.1 audio section strings. docs/docs/new-features.md stays as on 4.1. Client: - client/main.html: the six stylesheet links take 4.0.2's ?v=VERSION; the 4.1-only theme-dark.css link after them is unchanged here. - Types and initial values of meetingClientSettings: the 4.1 stats thresholds (objects), without public.stats.help, which 4.0.2 removed (4eaee6b) together with its last reader. - bn-shared-notes/component.tsx: 4.0.2's equation and diagram blocks and floating-UI portal element (#26221), with the 4.1 theme prop (dark when the native dark theme is on). - layout/observer.tsx: the 4.1 getInitialFontSize(), which already prefers the saved font size; that is the fix 4.0.2 made inline (#26399). - generic-content/manager.tsx: the 4.1 effect that unregisters removed sidekick apps (b15701d). 4.0.2 also clears their badge and menu name there (#25998); that moves into the 4.1 effect in a follow-up commit. - Settings > Audio: the 4.1 section and device-test messages next to 4.0.2's voice isolation messages (#26095); styles import both defaultBorder and colorStandout. - Navigation sidebar badges: 4.0.2 moves the badge rules into common/notification-badge (#25998), so the sidebar button and sidebar styles take its fragments and keep the 4.1 dark-theme tokens elsewhere. The apps gallery badge styles file, deleted by 4.0.2 and only recoloured by 4.1, stays deleted. Lockfile: bigbluebutton-html5/package-lock.json was regenerated, not merged. The merged package.json equals 4.0.2's without darkreader, so the lock starts from 4.0.2's (npm drops darkreader and its rollup binaries), then npm update brings the six packages 4.1 had at a newer version up to it. No package is behind either parent, except the nested copy of @floating-ui/core and dom 1.8.0 that 4.1 carried under @floating-ui/react-dom; the merged lock uses one 1.7.6 copy, as 4.0.2 does. The other lockfiles merged cleanly and equal 4.0.2's. Docs: - configuration-files.md and release-testing.md are still CRLF on 4.0 and LF on 4.1. Merged with line endings normalised, they have no conflict. - customize.md: the 4.1 source link with 4.0.2's #get-post-create anchor. Playwright: core/elements.ts keeps both sides' audio selectors.
4.0.2 brings the API conformance suite (#26257). Its per-PR job brings up the Tier 1 stack from the packages the build made and runs the suite against it. On the merged tree the stack did not come up: the nginx container stayed unhealthy with host not found in upstream "bbb-graphql-middleware" in /usr/share/bigbluebutton/nginx/graphql.nginx:8 On 4.1 the packages' nginx locations proxy to named upstreams (e376575). bbb-config installs them as /etc/nginx/conf.d/bbb-upstreams.conf. Tier 1 does not install bbb-config, and on 4.0 the locations named addresses directly, so its nginx image had no such file. - compose.yaml, images/Dockerfile: the nginx image copies bbb-upstreams.conf from build/packages-template/bbb-config, as a build context like bigbluebutton-config already is, so it is the package's own file rather than a hand copy. - akka-apps/bbb-apps-akka.conf.in mirrors the operator config file the akka-apps preinst writes. On 4.1 the preinst also lets BBB_WEB_API and SHARED_SECRET override the two values (0413ab4), and check-copies.sh warned that the preinst had changed. The mirror now writes the same lines. Tier 1 sets neither variable, so its values are unchanged. copies.sha256 records the 4.1 preinst (check-copies.sh --update). With the debs built from this branch the stack comes up healthy, and the suite's CI selection runs every case: 739 cases, 700 passing against the 4.0 recordings. The 38 that differ are recorded in the next commit.
Forward-merge of v4.0.x-develop at 112214e into v4.1.x-develop at 1635133. Merge base 28d54de (#26257, merged in #26442). Resolutions: - profile-settings/component.tsx: combined. 4.1's PreviewStatus replaced the inline containerStyle, so it stays out; 4.0's isCamLocked return and "Enable webcam" placeholder (#26213) go before 4.1's CameraPreview. - profile-settings/styles.ts: 4.1's palette imports plus colorOffWhite, which 4.0's placeholder uses. - recording/styles.js: 4.1's colorTextEmphasis with 4.0's confirmationButtonFloor (#26314). - request-unmute-modal/styles.js: stays deleted, as on 4.1. 4.1's shared media-consent-modal (f75c010) replaced the RequestModalContent row that 4.0's min-width and narrow-phone change (#26314) styles. - settings/container.jsx: combined. 4.0's pagination source and useIsPaginationToggleAllowed (#26468) in 4.1's useSettingsProps, and paginationToggleLocked in its returned props, so the pre-flight settings modal gets it too. - settings/submenus/application/styles.js: 4.0's. The language selector is now a BBBSelect (#26389), so the native select rule 4.1 recoloured has no target. - video-preview/hooks/types.ts, useVideoPreview.ts: combined. Both sides' options (skipPreview, deferInitialization; waitForCameraPermission). 4.0 moved the mount-time camera opening from the cameraDisabled effect into startPreview, called on mount, and the effect now reopens only a started preview. 4.1's deferInitialization check moves with it, from the effect into startPreview, so pre-flight still opens no camera until the user enables it. - palette.js: combined. 4.0's colorWarning #FFC845 and btnWarningColor #393C48 (#26312) and its new status tokens; 4.1's notice, scrim and *ColorSurface tokens. - locales de, eu, it_IT: 4.1's, as in #26011, #26198, #26346 and #26442. en.json: both sides' strings; a key-level three-way check matches. - playwright core/helpers.ts: 4.0's override-aware create defaults (#26359) with 4.1's encoded name and meetingID. - bigbluebutton.properties, docs/data/create.tsx: both disabledFeatures entries, layoutView (4.1) and lockSettings (4.0). - docs configuration-files.md, release-testing.md: still CRLF on 4.0 and LF on 4.1; merged with line endings normalised. 4.1's bbb-export-annotations override row stays (4.1 ships the override); 4.0's other override rows and nginx text, with the 4.1 source link; the new unmute case with its spec link on v4.1.x-develop. - docs customize.md: 4.0's locale override steps, downloading from v4.1.x-release. - docs new-features.md: 4.1's file, unchanged. - bbb-shared-notes-server/run-in-systemd.sh: kept, as on 4.1. 4.0 deleted it (#26464), but 4.1's image (bbb-shared-notes-server/Dockerfile) still copies it. The follow-up "build(docker): stop copying the removed run-in-systemd.sh into the shared-notes image" removes both. This merge does not pass the Playwright type check alone: bigbluebutton-tests/playwright/core/elements.ts merged without a conflict but declares layoutContainer twice, since both lines added it (4.1 in c5c2c71, 4.0 in ad12223). The next commit, "test(playwright): declare the layoutContainer selector once", drops 4.1's copy. The packages build, and Playwright's own transpiler runs the suite as is. # Conflicts: # bigbluebutton-html5/imports/ui/components/profile-settings/component.tsx # bigbluebutton-html5/imports/ui/components/profile-settings/styles.ts # bigbluebutton-html5/imports/ui/components/recording/styles.js # bigbluebutton-html5/imports/ui/components/request-unmute-modal/styles.js # bigbluebutton-html5/imports/ui/components/settings/container.jsx # bigbluebutton-html5/imports/ui/components/settings/submenus/application/styles.js # bigbluebutton-html5/imports/ui/components/video-preview/hooks/types.ts # bigbluebutton-html5/imports/ui/components/video-preview/hooks/useVideoPreview.ts # bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js # bigbluebutton-html5/public/locales/de.json # bigbluebutton-html5/public/locales/en.json # bigbluebutton-html5/public/locales/eu.json # bigbluebutton-html5/public/locales/it_IT.json # bigbluebutton-tests/playwright/core/helpers.ts # bigbluebutton-web/grails-app/conf/bigbluebutton.properties # docs/docs/administration/configuration-files.md # docs/docs/administration/customize.md # docs/docs/data/create.tsx # docs/docs/new-features.md # docs/docs/testing/release-testing.md
What does this PR do?
Adds
bigbluebutton-tests/api-conformance/, a black-box test suite for the public HTTP API (/bigbluebutton/api/*), and the CI jobs that run it. Nothing outside that directory and.github/workflows/changes.runner/schema/case.schema.json), run bybbb-conform, a Go runner inrunner/. A case is a series of steps:presence: a headless user who joins the meeting the way the HTML5 client does, over bbb-graphql-middleware's websocket.graphqlruns queries and mutations as that user (presenter and role changes, guest approval, lock settings, breakout rooms, ...);bus,redisandfs: what bbb-web and akka-apps did on the redis bus, in redis and in/var/bigbluebutton, read throughbbb-conform tap, a small service that runs on the server;sink: the callbacks bbb-web makes and the URLs it fetches, received bybbb-conform sink.bbb-conform recordruns each case twice against bbb-web and writes what it answered togolden/bbb-web/, normalized: IDs, timestamps and random values are masked, andmasks.yamladds rules.run --goldenthen compares every step with its recording. A value that differs between the two passes is reported as unstable instead of written.reviewshows a recording, or what changed since a commit, next to its case.contractis documented or relied-on behaviour.compatis a bbb-web quirk that integrations may depend on; its header names the doc it departs from.defectasserts the correct behaviour where bbb-web gets it wrong, and is listed inexpectations/bbb-web.yaml. Behaviour nobody has decided on yet, such as a methodUrlMappingsdoesn't map, is taggedtriageand only recorded, so a change to it still shows up.presenceusers;env/): bbb-web, akka-apps, redis, Postgres, Hasura, bbb-graphql-middleware, bbb-graphql-actions, nginx, the tap and the sink in Docker Compose. They run from debs built out of this tree with each package's own build script, in the image CI builds packages in. The services share one network namespace, so they reach each other on 127.0.0.1 as on a single-server install. LibreOffice converts Office documents, and ClamAV is optional. Config profiles (env/bbb-web/profiles/) switch bbb-web settings for the cases that need them. There is no FreeSWITCH, LiveKit, shared notes or recording processing.env/tier1/check-copies.shwarns when a package file Tier 1 mirrors by hand has changed.api-conformanceinautomated-tests.yml: brings up Tier 1 from the debs that workflow'sbuild-packagejobs made, so it builds nothing itself, then runs every case exceptslowagainst the recordings with--fail-on-skip. A light job first checks the changed paths: the suite, or anything Tier 1 is built from or mirrors (bbb-web, bbb-common-web, bbb-common-message, akka-apps, the GraphQL side, bigbluebutton-config, the build scripts and package templates it uses). Otherwise the job is skipped. The counts go in an annotation and the gap matrix in the job summary. The reports, plus the services' logs on failure, are uploaded asapi-conformance-bbb-web.api-conformance-slowinnightly-tests.yml: the 14slowcases (callback retries, expiry timing), about 20 minutes, from the packages of the newest Automated tests build ofv4.0.x-develop.api-conformance-runner.yml:gofmt,go vet(Linux, macOS and Windows) andgo test -racefor the runner, on PRs that touch the suite. Its tests run against in-process fakes of bbb-web, redis and the GraphQL side, and also load the suite's own cases and recordings.diffruns the cases on two targets and lists every difference in the normalized answers, including the ones no case checks for: missing elements, tag case, order, status, Content-Type. When both targets have a tap, it also compares what akka-apps made of each create.gapturns run reports into a pass/fail matrix per endpoint and target.targets/bbb-api.yamlandexpectations/bbb-api.yamlare ready for bbb-api, which isn't on this branch.Closes Issue(s)
None.
Motivation
bbb-web's API has few automated tests. The Spock specs in
bigbluebutton-web/src/testcover getJoinUrl and checksum validation, andApiControllerSpecis@Ignored. Much of what integrations rely on (error formats, element order, status codes, what a parameter or method does) is written down nowhere but the code.bbb-api, the Go replacement on
develop, has to reproduce that behaviour. This suite pins down what bbb-web answers today, so that:diffandgapshow what it still does differently;diffof, say, a 3.0 and a 4.0 server lists what an integration would see change.How to test
Needs Linux on amd64, Docker with Compose 2.24 or later, and Go 1.26 (
runner/go.mod).The runner's own tests, with no server:
The suite against Tier 1, as CI runs it:
--tags slowinstead of--exclude-tags slowruns the nightly cases. Against another server, setBBB_URL(e.g.https://bbb.example.com/bigbluebutton/) andBBB_SECRET. The side-effect cases also needBBB_TAP_URL, the callback casesBBB_SINK_URL, and the cases that switch bbb-web's configBBB_EXEC; without them, those cases are skipped. The README covers all three.To see the check catch a changed answer, edit a file in
golden/bbb-web/and run again: that case fails.Results at 9a358e0 (2026-11-05):
api-conformancejob: 739 cases, 738 passed and 1 expected failure (thedefectcase), in under 9 minutes including bringing up Tier 1.slowcases: 14/14 on Tier 1 at 847527c (2026-11-04). None of them has changed since.More
Size. 1,316 new files and two changed workflows, about 55k lines, none of it product code. The runner is 16k lines of Go, with 8.4k of tests and 8.2k of test data. The 753 recordings are 11k lines, and the 259 case files 7.7k. A reading order: the README, a few cases next to their recordings,
env/, the workflows, thenrunner/.For contributors, once merged: a PR that changes what bbb-web answers fails
api-conformanceuntil it re-records the cases it changes (bbb-conform record, then review the diff). The README's "Recording what a server answers" section explains how. The nightly job first runs once this is merged, since schedules run on the default branch.Ready for review. The rest of the API comes as follow-up PRs on top of this one.
Not in this PR:
envsteps and response schemas: the runner skips them until they're implemented;v4.0.x-develop;Added/updated documentation