Update integration tests to use dual imports per ADR-030 #269

Closed
opened 2025-12-31 16:48:50 -08:00 by jwilger · 1 comment
jwilger commented 2025-12-31 16:48:50 -08:00 (Migrated from github.com)

Summary

Update all integration tests to explicitly separate "application developer" imports (from eventcore) from "test infrastructure" imports (from eventcore-types).

Parent Issue

  • #266 Implement ADR-030: Layered Crate Public API Design
  • Depends on: #267, #268

Background

Integration tests currently import everything from eventcore. Per ADR-030, tests should clearly separate:

  • Types an application developer would use (from eventcore)
  • Types only needed for test infrastructure like mock stores (from eventcore-types)

Files to Update

  1. eventcore/tests/I-001-single_stream-command_test.rs
  2. eventcore/tests/I-003-retry_policy_test.rs
  3. eventcore/tests/I-004-multi_stream_atomic_test.rs
  4. eventcore/tests/I-007-dynamic_stream_discovery_test.rs
  5. eventcore/tests/projection_event_retry_config_test.rs
  6. eventcore/tests/projection_poll_retry_test.rs
  7. eventcore/tests/projection_runner_test.rs

Pattern to Follow

// Application developer imports (from eventcore)
use eventcore::{
    execute, run_projection, RetryPolicy, CommandError, Event, StreamId, Projector,
    FailureContext, FailureStrategy, StreamPosition,
};

// Test infrastructure imports (from eventcore-types)
// These types are needed for implementing mock stores in tests
use eventcore_types::{
    EventStore, EventStoreError, EventStreamReader, EventStreamSlice,
    StreamWrites, StreamVersion,
};

Acceptance Criteria

  • All integration tests have clearly separated imports with comments
  • No test imports internal types from eventcore (like ProjectionRunner)
  • All tests pass
  • Tests serve as documentation for the intended API usage
## Summary Update all integration tests to explicitly separate "application developer" imports (from `eventcore`) from "test infrastructure" imports (from `eventcore-types`). ## Parent Issue - #266 Implement ADR-030: Layered Crate Public API Design - Depends on: #267, #268 ## Background Integration tests currently import everything from `eventcore`. Per ADR-030, tests should clearly separate: - Types an application developer would use (from `eventcore`) - Types only needed for test infrastructure like mock stores (from `eventcore-types`) ## Files to Update 1. `eventcore/tests/I-001-single_stream-command_test.rs` 2. `eventcore/tests/I-003-retry_policy_test.rs` 3. `eventcore/tests/I-004-multi_stream_atomic_test.rs` 4. `eventcore/tests/I-007-dynamic_stream_discovery_test.rs` 5. `eventcore/tests/projection_event_retry_config_test.rs` 6. `eventcore/tests/projection_poll_retry_test.rs` 7. `eventcore/tests/projection_runner_test.rs` ## Pattern to Follow ```rust // Application developer imports (from eventcore) use eventcore::{ execute, run_projection, RetryPolicy, CommandError, Event, StreamId, Projector, FailureContext, FailureStrategy, StreamPosition, }; // Test infrastructure imports (from eventcore-types) // These types are needed for implementing mock stores in tests use eventcore_types::{ EventStore, EventStoreError, EventStreamReader, EventStreamSlice, StreamWrites, StreamVersion, }; ``` ## Acceptance Criteria - [ ] All integration tests have clearly separated imports with comments - [ ] No test imports internal types from `eventcore` (like `ProjectionRunner`) - [ ] All tests pass - [ ] Tests serve as documentation for the intended API usage
jwilger commented 2025-12-31 17:32:24 -08:00 (Migrated from github.com)

Closing: Parent issue closed

Closing: Parent issue closed
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
Slipstream/eventcore#269
No description provided.