test: consolidate test infrastructure and remove low-value tests #137

Closed
opened 2026-09-24 12:39:10 +00:00 by Grandiras · 1 comment
Owner

Part of the v0.7.0 update cycle (wave 8). Test infrastructure consolidation and low-value test removal. Do this after the feature work so it doesn't conflict with every PR.

  • One shared scripted HttpMessageHandler stub and an XrpcTestClient fixture replace the 27 hand-rolled handlers.
  • One XrpcTestHost replaces the 4 TestServer hosts.
  • Token-store and space-store contract base classes run against every implementation.
  • Move EF tests to Sqlite and drop Microsoft.EntityFrameworkCore.InMemory, which also removes the version-pin trap.
  • One enum-driven [RequiresFact(...)] for the env-gated integration tests (RequiresPdsFact/RequiresBlueskyFact currently ignore ATPROTO_REQUIRE_INTEGRATION).
  • Unit tests must not touch the network: SecurityTests opens real TCP connections and AtProtoClientApplyOAuthTests does real DNS.
  • Remove tests that test nothing: DTO getter tests (now covered by the convention and drift tests), constant-equals-literal tests, smoke tests, and self-consistency tests subsumed by pinned vectors. Merge duplicate facts into theories.
  • Integration CI: AuthenticatedClientFixture provisions its own account (like SpaceNetworkFixture), and the CI filter widens beyond PdsAdminTests, so login/refresh/record CRUD run against the reference PDS on every PR.
  • Coverage for core paths that have no unit tests today: LoginAsync/ResumeSessionAsync/LogoutAsync, RecordCollection CRUD, and the custom-XRPC entry points.
Part of the v0.7.0 update cycle (wave 8). Test infrastructure consolidation and low-value test removal. Do this after the feature work so it doesn't conflict with every PR. - [ ] One shared scripted `HttpMessageHandler` stub and an `XrpcTestClient` fixture replace the 27 hand-rolled handlers. - [ ] One `XrpcTestHost` replaces the 4 TestServer hosts. - [ ] Token-store and space-store **contract** base classes run against every implementation. - [ ] Move EF tests to Sqlite and drop `Microsoft.EntityFrameworkCore.InMemory`, which also removes the version-pin trap. - [ ] One enum-driven `[RequiresFact(...)]` for the env-gated integration tests (`RequiresPdsFact`/`RequiresBlueskyFact` currently ignore `ATPROTO_REQUIRE_INTEGRATION`). - [ ] Unit tests must not touch the network: `SecurityTests` opens real TCP connections and `AtProtoClientApplyOAuthTests` does real DNS. - [ ] Remove tests that test nothing: DTO getter tests (now covered by the convention and drift tests), constant-equals-literal tests, smoke tests, and self-consistency tests subsumed by pinned vectors. Merge duplicate facts into theories. - [ ] Integration CI: `AuthenticatedClientFixture` provisions its own account (like `SpaceNetworkFixture`), and the CI filter widens beyond `PdsAdminTests`, so login/refresh/record CRUD run against the reference PDS on every PR. - [ ] Coverage for core paths that have no unit tests today: `LoginAsync`/`ResumeSessionAsync`/`LogoutAsync`, `RecordCollection` CRUD, and the custom-XRPC entry points.
Author
Owner

Splitting this into two PRs, so most of it can run in parallel with the second half of #136:

  1. Now, branch issue-137-tests: the shared scripted HttpMessageHandler stub and XrpcTestClient, one XrpcTestHost, the enum-driven [RequiresFact(...)], network-free unit tests, removing low-value tests, and the core coverage gaps. All of it stays out of the EF-store and DI-registration tests that #136 is moving.
  2. After #136 merges: token-store and space-store contract base classes, EF tests on SQLite with Microsoft.EntityFrameworkCore.InMemory dropped, and the integration-CI changes.
    The issue closes with the second PR.
Splitting this into two PRs, so most of it can run in parallel with the second half of #136: 1. **Now**, branch `issue-137-tests`: the shared scripted `HttpMessageHandler` stub and `XrpcTestClient`, one `XrpcTestHost`, the enum-driven `[RequiresFact(...)]`, network-free unit tests, removing low-value tests, and the core coverage gaps. All of it stays out of the EF-store and DI-registration tests that #136 is moving. 2. **After #136 merges:** token-store and space-store contract base classes, EF tests on SQLite with `Microsoft.EntityFrameworkCore.InMemory` dropped, and the integration-CI changes. The issue closes with the second PR.
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
Grandiras/ATProto.NET#137
No description provided.