Conformance
For adapter authors
The Conformance SDK (protocol/conformance) is a suite that any MCoP server deployment can run. It talks to the server only through the public client SDK, so it checks what an application sees, not the internals.
Server contract
A server under test MUST:
- register an agent with the ID
mockasmockagent.Agent{}(no delay, no failure); - accept the principals the suite provides and let the suite connect as any of them;
- isolate accounts: principals 2 and 3 are in other accounts than principals 0 and 1.
Running it
func TestConformance(t *testing.T) {
conformance.Run(t, func(t *testing.T) conformance.Target {
srv := startMyServer(t) // with the mock agent and the principals
return conformance.Target{Connect: func(t testing.TB, p server.Principal) *robotelos.Client {
return dialAs(t, srv, p)
}}
})
}
conformance.Run runs each scenario as a subtest with a fresh target. conformance.Scenarios() lists them, so a caller can run a subset.
Scenarios
| Scenario | Checks |
|---|---|
RoundTrip | A message reaches the mock agent and its reply reaches the client |
CommandsAreIdempotent | A retry with the same command_id and payload returns the original receipt and applies nothing |
AccountsAreIsolated | A principal in one account cannot see or change another account’s conversation |
ApprovalAnswersOnce | An approval is accepted once; a second answer is STALE |
GroupInviteJoinAndTalk | Invite, join and speak in a group |
AgentsAnswerGroupMentionsOnly | In a group, only mentioned agents reply |
GroupAuthorization | Roles restrict who may invite, speak and change membership |
RemovedParticipantStopsReceiving | A removed participant’s stream ends with resnapshot_required |
AgentsLeaveWithTheirOwner | An agent leaves when its owner leaves |
The scenarios run on every transport and on PostgreSQL. A server that fails any scenario is not conformant for that transport or store.
Client conformance
Clients are checked the same way: a client library passes if it completes the scenarios through the public API. A client written in another language SHOULD reproduce the same behavior for the cursor, retry and resnapshot rules in Delivery and Commands.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.