[tests] Repository has zero working tests — rewrite SDK + server integration tests against current API #2

Open
opened 2026-04-26 01:29:45 +00:00 by mik-tf · 0 comments
Owner

State as of 2026-04-26

After cleanup in [PR #N], the workspace has zero working tests:

$ cargo test --workspace --all-targets
... (8 crates) ...
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured;  (× 8)

No unit tests, no doc tests, no integration tests.

How we got here

Two integration test files existed but were stale and didn't compile:

  1. crates/hero_matrixchat_sdk/tests/integration_test.rs — referenced hero_matrixchat_sdk::MatrixClient (the old direct-Matrix-protocol client). The SDK was refactored to be the OpenRPC client for hero_matrixchat_server (now exposing HeroMatrixchatServerClient). The old MatrixClient no longer exists in the SDK; the integration test was orphaned.

  2. crates/hero_matrixchat_examples/tests/integration.rs — used MatrixChatClient::new(&path) (no such constructor) and client.health() with no args (now requires HealthInput { profile: None }). API drift from the same SDK refactor.

Both caused 122 cumulative compile errors and made lint.yaml permanently red. Both were deleted in the CI-sweep PR. Deleting them did not lose any working test coverage (they were already non-functional).

What needs to happen

Three distinct kinds of tests are missing and should be added:

  • SDK unit tests in crates/hero_matrixchat_sdk/src/ — test the config::*, error::* modules and the type aliases. Plain cargo test runnable, no external services.
  • SDK round-trip integration tests in crates/hero_matrixchat_sdk/tests/ — bring up an in-process hero_matrixchat_server mock or use mockito/wiremock to verify the OpenRPC client serialises requests + parses responses correctly. No real Matrix server needed.
  • End-to-end integration tests (the kind the deleted examples/tests/integration.rs was attempting) — require a running hero_matrixchat binary + hero_proc + a Matrix homeserver. Should be #[ignore]'d for CI, runnable as cargo test -- --ignored on a dev box with the live stack. Document the setup in a header comment.

Acceptance criteria

  • cargo test --workspace --all-targets reports a meaningful number of passing tests (not zero)
  • CI runs unit + SDK round-trip tests on every push (no external services required)
  • E2E integration tests exist and are documented + #[ignore]'d so they run on demand only
  • PR #N can close, marking hero_matrixchat fully on lhumina_code/home#188

Signed-off-by: mik-tf

## State as of 2026-04-26 After cleanup in [PR #N], the workspace has **zero working tests**: ``` $ cargo test --workspace --all-targets ... (8 crates) ... test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; (× 8) ``` No unit tests, no doc tests, no integration tests. ## How we got here Two integration test files existed but were stale and didn't compile: 1. `crates/hero_matrixchat_sdk/tests/integration_test.rs` — referenced `hero_matrixchat_sdk::MatrixClient` (the old direct-Matrix-protocol client). The SDK was refactored to be the OpenRPC client for `hero_matrixchat_server` (now exposing `HeroMatrixchatServerClient`). The old `MatrixClient` no longer exists in the SDK; the integration test was orphaned. 2. `crates/hero_matrixchat_examples/tests/integration.rs` — used `MatrixChatClient::new(&path)` (no such constructor) and `client.health()` with no args (now requires `HealthInput { profile: None }`). API drift from the same SDK refactor. Both caused 122 cumulative compile errors and made `lint.yaml` permanently red. Both were deleted in the CI-sweep PR. Deleting them did not lose any working test coverage (they were already non-functional). ## What needs to happen Three distinct kinds of tests are missing and should be added: - [ ] **SDK unit tests** in `crates/hero_matrixchat_sdk/src/` — test the `config::*`, `error::*` modules and the type aliases. Plain `cargo test` runnable, no external services. - [ ] **SDK round-trip integration tests** in `crates/hero_matrixchat_sdk/tests/` — bring up an in-process `hero_matrixchat_server` mock or use `mockito`/`wiremock` to verify the OpenRPC client serialises requests + parses responses correctly. No real Matrix server needed. - [ ] **End-to-end integration tests** (the kind the deleted `examples/tests/integration.rs` was attempting) — require a running `hero_matrixchat` binary + `hero_proc` + a Matrix homeserver. Should be `#[ignore]`'d for CI, runnable as `cargo test -- --ignored` on a dev box with the live stack. Document the setup in a header comment. ## Acceptance criteria - [ ] `cargo test --workspace --all-targets` reports a meaningful number of passing tests (not zero) - [ ] CI runs unit + SDK round-trip tests on every push (no external services required) - [ ] E2E integration tests exist and are documented + `#[ignore]`'d so they run on demand only - [ ] PR #N can close, marking hero_matrixchat fully ✅ on https://forge.ourworld.tf/lhumina_code/home/issues/188 ## Related - CI sweep tracker: https://forge.ourworld.tf/lhumina_code/home/issues/188 - The PR that surfaced this gap: [PR #N — to be filled] Signed-off-by: mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_matrixchat#2
No description provided.